* New way to informing interaction delegate if ASCellNode get’s a setNeedsLayout call
* Remove nodeDidGetNeedsLayout as optional and better check if cell updates need to happen
* Differentiate between letting a normal display node and a cell node know that the size could have changed
* Check for _interactionDelegate is nil
* Add nullability to out pointer
* Adress comments and some renaming
Resolves#3037
This is a do-over of c85aa11, with the following differences:
- Fixed `_ASTableViewCell` properties **always** being mutated to match corresponding `ASCellNode` passthrough properties, even when the hosted `ASCellNode` is currently `nil`. Now only inheriting passthrough properties when there’s an actual instance of `ASCellNode` to read them from.
- Corrected spelling of `ASCellNode`’s `separatorInset` property.
- Reverted `_ASCollectionViewCell` inheriting the hosted cell node’s `backgroundColor` & `clipsToBounds` properties. This seems to be surprising and unwanted behavior to some, as seen in #3053 and #3044.
- Moved passthrough of `UITableViewCell`’s `selectedBackgroundView` into `_ASTableViewCell`’s `-setNode:` for consistency.
* Clean up snapshot test cases:
- Drop 32bit snapshots
- Update iOS 9 snapshots and move some others to the correct directory
- Remove `setUp` overrides in subclasses of `ASLayoutSpecSnapshotTestCase` that set `recordMode` flag. Doing so in multiple places make it difficult to enable/dis
able the flag for all layout spec test cases. It can always be overridden locally if need
to.
- Fix BUCK build
* Fix testThatOnDidLoadThrowsIfCalledOnLoadedOffMain of ASDisplayNodeTests
These changed recently with the addition of the ability to provide nodeBlocks.
It might be more strict to assert that nil can't be provided unless the datasource supports
inter-op, but I think it is also pretty reasonable to just use an empty ASCellNode in this case.
Either way, I'm really amazed / surprised to see all the improvements that appeared in ASDataController!
* Build ASElementMap and use it
* Keep building!
* Clean up
* Restrict ASDataController subclassing
* Clean up more
* More rearranging
* Dear lord it's time for bed
* Make things clearer
* Sadly remove subclassing restriction for ASDataController
* Remove dead initializer
* Fix deadlock occurs during layout of ASDisplayNode that triggered a change set update in ASDataController
* Access _transitionInProgress ivar directly if already locked
* Refactor ASDataController
Check optional methods in ASDataControllerSource
* Reimplement reloadData
* Refactor new code
- No more new/inserted contexts flag
- Encapsulate code shared between reloadData and updateWithChangeSet
- Remove dataControllerWillDeleteAllData delegate method
- Hierarchy changes no longer needs to conform to NSCopying
- Reword TODOs
* Forgot to call completion block of reloadData :P
* Completion block of -[ASDataController reloadDataWithCompletion:] is nullable
* Data queried from ASCollectionNode and ASTableNode should be in UIKit index space
- This helps to avoid immature node allocation, especially when node virtualization is a thing
- However, this means that -reloadDataInitiallyIfNeeded in ASCollectionNode and ASTableNode must wait until all updates are finished.
* ASDataController shouldn't assume that allocated nodes were also laid out
* Revert "Data queried from ASCollectionNode and ASTableNode should be in UIKit index space"
This reverts commit 7bc977b3808a92f484b297781d0f5b30aa258e17.
* -nodeAtIndexPath: of ASDataController now forces node allocation, with the assumption that clients absolutely need it.
- Revisit this when node virtualization is implemented.
* ASDataController only grab changeSet.completionHandler when needed because it'll be niled out
* Fix ASTableViewTests related to reloadData
* Fix testThatDeletedItemsAreMarkedInvisible in ASCollectionViewTests
* Minor changes in ASCollectionView and ASTableView
* ASCollectionView and ASTableView shouldn't call [super reloadData] before their data controller does anything
* Address comments
* Fuse reloadData into -updateWithChangeSet: of ASDataController
* reloadData shouldn't be called as if it's inside a batch
- It can't be used in conjuntion with other updates.
- Calling it inside a batch update during the initial load can cause data inconsistency thrown by UICollectionView/UITableView
* Refactor ASDataControllerDelegate and ASRangeControllerDelegate
- Replace delegate methods in these protocols with -willUpdateWithChangeSet and -didUpdateWithChangeSet.
- ASRangeController, ASCollectionView and ASTableView are simplified because of this.
* Fix mismatch between sorting orders in ASDataController
* Forgot to call completion handler of reload change sets
* Make sure ASCollectionView is compatible with the behavior of UICollectionView's reloadData
- Since UICollectionView's reloadData doesn't requery data source but defers until the next layout pass, we need to wait until then to update range controller and do batch fetching.
- `-[ASCollectionView waitUntilAllUpdatesAreCommited]` needs to force a layout pass to make sure
everything is ready after it returns.
* testSectionIndexHandling of ASTableViewTests should only check visible nodes. Other nodes will be re-measured later.
* ASTableView is not ready until the first layout pass finished
* Address comments
* Bug fixes
* [TextKit] Fix text layout issue for CJK laungages
* [ASTextKitContext] Delay filling _textStorage with attributedString until calling addLayoutManager.
* Fix pager node and deprecate zeroContentInsets flag
* Do it with the visible state callback
* There we are
* Put viewController in node debug description
* ASViewController can be used without a node
- If a node isn't provided by developers via -initWithNode:, a default one will be created and used internally.
- This allows developers to use ASViewController like a normal UIViewController and as a base class for all view controllers among which some use a node hierarchy and some don't.
* Update ASDKgram to use a shared base ASViewController
* Minor fixes in ASViewController:
- If its node isn't provided by users, don't replace the view controller's view with the default node's view because it might be loaded from a nib.
- Init a vanilla ASDisplayNode if a node isn't provided.
* Some smaller cleanup
* Remove dummy node for ASViewController if it’s used without a node
* Safer checks in ASDisplayNode’s setFrame before assigning bounds and position
* Consolidate checks in one place
* Assert with ASDisplayNodeNonFatal
* Allow position to be negative