Add nullability annotations for public API

This commit is contained in:
Adlai Holler
2015-09-16 15:15:07 -07:00
parent f275d858ae
commit 814f72535c
21 changed files with 170 additions and 112 deletions

View File

@@ -18,6 +18,7 @@
@protocol ASCollectionViewDataSource;
@protocol ASCollectionViewDelegate;
NS_ASSUME_NONNULL_BEGIN
/**
* Node-based collection view.
@@ -90,7 +91,7 @@
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
*/
- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion;
- (void)performBatchAnimated:(BOOL)animated updates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;
/**
* Perform a batch of updates asynchronously. This method must be called from the main thread.
@@ -101,7 +102,7 @@
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
*/
- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion;
- (void)performBatchUpdates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.
@@ -110,7 +111,7 @@
* the main thread.
* @warning This method is substantially more expensive than UICollectionView's version.
*/
- (void)reloadDataWithCompletion:(void (^)())completion;
- (void)reloadDataWithCompletion:(void (^ _Nullable)())completion;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.
@@ -169,7 +170,7 @@
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
* before this method is called.
*/
- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths;
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
/**
* Deletes the items specified by an array of index paths.
@@ -179,7 +180,7 @@
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
* before this method is called.
*/
- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths;
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
/**
* Reloads the specified items.
@@ -189,7 +190,7 @@
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
* before this method is called.
*/
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
/**
* Moves the item at a specified location to a destination location.
@@ -217,7 +218,7 @@
*
* @returns an array containing the nodes being displayed on screen.
*/
- (NSArray *)visibleNodes;
- (NSArray<ASCellNode *> *)visibleNodes;
/**
* Query the sized node at `indexPath` for its calculatedSize.
@@ -303,7 +304,7 @@
@optional
- (void)collectionView:(ASCollectionView *)collectionView willDisplayNodeForItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath*)indexPath;
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath *)indexPath;
/**
* Receive a message that the collectionView is near the end of its data set and more data should be fetched if
@@ -353,3 +354,5 @@
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters ASDISPLAYNODE_DEPRECATED;
@end
NS_ASSUME_NONNULL_END