diff --git a/AsyncDisplayKit/Details/ASAbstractLayoutController.h b/AsyncDisplayKit/Details/ASAbstractLayoutController.h index 45b92ece00..f0cb3bb2db 100644 --- a/AsyncDisplayKit/Details/ASAbstractLayoutController.h +++ b/AsyncDisplayKit/Details/ASAbstractLayoutController.h @@ -9,6 +9,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + @interface ASAbstractLayoutController : NSObject - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType; @@ -18,3 +20,5 @@ @property (nonatomic, assign) ASRangeTuningParameters tuningParameters ASDISPLAYNODE_DEPRECATED; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASBasicImageDownloader.h b/AsyncDisplayKit/Details/ASBasicImageDownloader.h index 2d96296280..765a08e94b 100644 --- a/AsyncDisplayKit/Details/ASBasicImageDownloader.h +++ b/AsyncDisplayKit/Details/ASBasicImageDownloader.h @@ -8,6 +8,7 @@ #import +NS_ASSUME_NONNULL_BEGIN /** * @abstract Simple NSURLSession-based image downloader. @@ -15,3 +16,5 @@ @interface ASBasicImageDownloader : NSObject @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASBatchContext.h b/AsyncDisplayKit/Details/ASBatchContext.h index 94c42293b2..452582f9cf 100644 --- a/AsyncDisplayKit/Details/ASBatchContext.h +++ b/AsyncDisplayKit/Details/ASBatchContext.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + /** * @abstract A context object to notify when batch fetches are finished or cancelled. */ @@ -58,3 +60,5 @@ - (void)beginBatchFetching; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h index 9aa25db0a9..632ba46bf8 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h +++ b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h @@ -9,6 +9,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + @class ASCollectionView; @interface ASCollectionViewLayoutController : ASAbstractLayoutController @@ -16,3 +18,5 @@ - (instancetype)initWithCollectionView:(ASCollectionView *)collectionView; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASDataController.h b/AsyncDisplayKit/Details/ASDataController.h index 68e586daa8..6399f9a8c0 100644 --- a/AsyncDisplayKit/Details/ASDataController.h +++ b/AsyncDisplayKit/Details/ASDataController.h @@ -11,6 +11,8 @@ #import #import "ASFlowLayoutController.h" +NS_ASSUME_NONNULL_BEGIN + @class ASCellNode; @class ASDataController; @@ -66,22 +68,22 @@ typedef NSUInteger ASDataControllerAnimationOptions; Called for batch update. */ - (void)dataControllerBeginUpdates:(ASDataController *)dataController; -- (void)dataController:(ASDataController *)dataController endUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL))completion; +- (void)dataController:(ASDataController *)dataController endUpdatesAnimated:(BOOL)animated completion:(void (^ _Nullable)(BOOL))completion; /** Called for insertion of elements. */ -- (void)dataController:(ASDataController *)dataController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)dataController:(ASDataController *)dataController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; /** Called for deletion of elements. */ -- (void)dataController:(ASDataController *)dataController didDeleteNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)dataController:(ASDataController *)dataController didDeleteNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; /** Called for insertion of sections. */ -- (void)dataController:(ASDataController *)dataController didInsertSections:(NSArray *)sections atIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)dataController:(ASDataController *)dataController didInsertSections:(NSArray *> *)sections atIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; /** Called for deletion of sections. @@ -139,7 +141,7 @@ typedef NSUInteger ASDataControllerAnimationOptions; - (void)endUpdates; -- (void)endUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL))completion; +- (void)endUpdatesAnimated:(BOOL)animated completion:(void (^ _Nullable)(BOOL))completion; - (void)insertSections:(NSIndexSet *)sections withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; @@ -149,11 +151,11 @@ typedef NSUInteger ASDataControllerAnimationOptions; - (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; -- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; -- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; -- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; /** * Re-measures all loaded nodes. Used to respond to a change in size of the containing view @@ -163,7 +165,7 @@ typedef NSUInteger ASDataControllerAnimationOptions; - (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; -- (void)reloadDataWithAnimationOptions:(ASDataControllerAnimationOptions)animationOptions completion:(void (^)())completion; +- (void)reloadDataWithAnimationOptions:(ASDataControllerAnimationOptions)animationOptions completion:(void (^ _Nullable)())completion; /** @name Data Querying */ @@ -171,10 +173,12 @@ typedef NSUInteger ASDataControllerAnimationOptions; - (NSUInteger)numberOfRowsInSection:(NSUInteger)section; -- (ASCellNode *)nodeAtIndexPath:(NSIndexPath *)indexPath; +- (nullable ASCellNode *)nodeAtIndexPath:(NSIndexPath *)indexPath; -- (NSArray *)nodesAtIndexPaths:(NSArray *)indexPaths; +- (NSArray *)nodesAtIndexPaths:(NSArray *)indexPaths; -- (NSArray *)completedNodes; // This provides efficient access to the entire _completedNodes multidimensional array. +- (NSArray *> *)completedNodes; // This provides efficient access to the entire _completedNodes multidimensional array. @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASDealloc2MainObject.h b/AsyncDisplayKit/Details/ASDealloc2MainObject.h index 06c298a541..88c08ba9c0 100644 --- a/AsyncDisplayKit/Details/ASDealloc2MainObject.h +++ b/AsyncDisplayKit/Details/ASDealloc2MainObject.h @@ -8,6 +8,7 @@ #import +NS_ASSUME_NONNULL_BEGIN /** * _OBJC_SUPPORTED_INLINE_REFCNT_WITH_DEALLOC2MAIN permits classes to implement their own reference counting and enforce @@ -19,3 +20,5 @@ - (BOOL)_isDeallocating; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASFlowLayoutController.h b/AsyncDisplayKit/Details/ASFlowLayoutController.h index 9b61a37b7d..a0845ed2d9 100644 --- a/AsyncDisplayKit/Details/ASFlowLayoutController.h +++ b/AsyncDisplayKit/Details/ASFlowLayoutController.h @@ -9,6 +9,9 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + +@class ASCellNode; typedef NS_ENUM(NSUInteger, ASFlowLayoutDirection) { ASFlowLayoutDirectionVertical, @@ -17,7 +20,7 @@ typedef NS_ENUM(NSUInteger, ASFlowLayoutDirection) { @protocol ASFlowLayoutControllerDataSource -- (NSArray *)completedNodes; // This provides access to ASDataController's _completedNodes multidimensional array. +- (NSArray *> *)completedNodes; // This provides access to ASDataController's _completedNodes multidimensional array. @end @@ -33,3 +36,5 @@ typedef NS_ENUM(NSUInteger, ASFlowLayoutDirection) { - (instancetype)initWithScrollOption:(ASFlowLayoutDirection)layoutDirection; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h b/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h index 6b7c236f34..736ff08753 100644 --- a/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h +++ b/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h @@ -8,6 +8,7 @@ #import +NS_ASSUME_NONNULL_BEGIN @interface ASHighlightOverlayLayer : CALayer @@ -19,16 +20,16 @@ @param rects Array containing CGRects wrapped in NSValue. @param targetLayer The layer that the rects are relative to. The rects will be translated to the receiver's coordinate space when rendering. */ -- (id)initWithRects:(NSArray *)rects targetLayer:(id)targetLayer; +- (id)initWithRects:(NSArray *)rects targetLayer:(nullable CALayer *)targetLayer; /** @summary Initializes with CGRects for the highlighting, in the receiver's coordinate space. @param rects Array containing CGRects wrapped in NSValue. */ -- (id)initWithRects:(NSArray *)rects; +- (id)initWithRects:(NSArray *)rects; -@property (atomic, strong) __attribute__((NSObject)) CGColorRef highlightColor; +@property (nullable, atomic, strong) __attribute__((NSObject)) CGColorRef highlightColor; @property (atomic, weak) CALayer *targetLayer; @end @@ -42,3 +43,5 @@ @property (nonatomic, assign, setter=as_setAllowsHighlightDrawing:) BOOL as_allowsHighlightDrawing; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASImageProtocols.h b/AsyncDisplayKit/Details/ASImageProtocols.h index 38465a2d75..f0720d51db 100644 --- a/AsyncDisplayKit/Details/ASImageProtocols.h +++ b/AsyncDisplayKit/Details/ASImageProtocols.h @@ -9,6 +9,7 @@ #import #import +NS_ASSUME_NONNULL_BEGIN @protocol ASImageCacheProtocol @@ -23,9 +24,9 @@ @discussion If `URL` is nil, `completion` will be invoked immediately with a nil image. This method should not block the calling thread as it is likely to be called from the main thread. */ -- (void)fetchCachedImageWithURL:(NSURL *)URL - callbackQueue:(dispatch_queue_t)callbackQueue - completion:(void (^)(CGImageRef imageFromCache))completion; +- (void)fetchCachedImageWithURL:(nullable NSURL *)URL + callbackQueue:(nullable dispatch_queue_t)callbackQueue + completion:(void (^)(CGImageRef _Nullable imageFromCache))completion; @end @@ -48,10 +49,10 @@ @result An opaque identifier to be used in canceling the download, via `cancelImageDownloadForIdentifier:`. You must retain the identifier if you wish to use it later. */ -- (id)downloadImageWithURL:(NSURL *)URL - callbackQueue:(dispatch_queue_t)callbackQueue - downloadProgressBlock:(void (^)(CGFloat progress))downloadProgressBlock - completion:(void (^)(CGImageRef image, NSError *error))completion; +- (id)downloadImageWithURL:(nullable NSURL *)URL + callbackQueue:(nullable dispatch_queue_t)callbackQueue + downloadProgressBlock:(void (^ _Nullable)(CGFloat progress))downloadProgressBlock + completion:(void (^ _Nullable)(CGImageRef image, NSError *error))completion; /** @abstract Cancels an image download. @@ -59,6 +60,8 @@ `downloadImageWithURL:callbackQueue:downloadProgressBlock:completion:`. @discussion This method has no effect if `downloadIdentifier` is nil. */ -- (void)cancelImageDownloadForIdentifier:(id)downloadIdentifier; +- (void)cancelImageDownloadForIdentifier:(nullable id)downloadIdentifier; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASIndexPath.h b/AsyncDisplayKit/Details/ASIndexPath.h index a6eb514a4c..fde2b24018 100644 --- a/AsyncDisplayKit/Details/ASIndexPath.h +++ b/AsyncDisplayKit/Details/ASIndexPath.h @@ -19,8 +19,11 @@ typedef struct { ASIndexPath end; } ASIndexPathRange; +NS_ASSUME_NONNULL_BEGIN + ASDISPLAYNODE_EXTERN_C_BEGIN + extern ASIndexPath ASIndexPathMake(NSInteger section, NSInteger row); extern BOOL ASIndexPathEqualToIndexPath(ASIndexPath first, ASIndexPath second); @@ -41,3 +44,5 @@ ASDISPLAYNODE_EXTERN_C_END - (ASIndexPath)ASIndexPathValue; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASLayoutController.h b/AsyncDisplayKit/Details/ASLayoutController.h index b45efd8793..70f6bd80af 100644 --- a/AsyncDisplayKit/Details/ASLayoutController.h +++ b/AsyncDisplayKit/Details/ASLayoutController.h @@ -12,6 +12,9 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + +@class ASCellNode; typedef struct { CGFloat leadingBufferScreenfuls; @@ -27,26 +30,28 @@ typedef struct { */ - (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType; -- (BOOL)shouldUpdateForVisibleIndexPaths:(NSArray *)indexPaths viewportSize:(CGSize)viewportSize rangeType:(ASLayoutRangeType)rangeType; +- (BOOL)shouldUpdateForVisibleIndexPaths:(NSArray *)indexPaths viewportSize:(CGSize)viewportSize rangeType:(ASLayoutRangeType)rangeType; - (NSSet *)indexPathsForScrolling:(ASScrollDirection)scrollDirection viewportSize:(CGSize)viewportSize rangeType:(ASLayoutRangeType)rangeType; @property (nonatomic, assign) ASRangeTuningParameters tuningParameters ASDISPLAYNODE_DEPRECATED; -- (BOOL)shouldUpdateForVisibleIndexPath:(NSArray *)indexPath viewportSize:(CGSize)viewportSize ASDISPLAYNODE_DEPRECATED; +- (BOOL)shouldUpdateForVisibleIndexPath:(NSIndexPath *)indexPath viewportSize:(CGSize)viewportSize ASDISPLAYNODE_DEPRECATED; - (NSSet *)indexPathsForScrolling:(ASScrollDirection)scrollDirection viewportSize:(CGSize)viewportSize ASDISPLAYNODE_DEPRECATED; @optional -- (void)insertNodesAtIndexPaths:(NSArray *)indexPaths withSizes:(NSArray *)nodeSizes; +- (void)insertNodesAtIndexPaths:(NSArray *)indexPaths withSizes:(NSArray *)nodeSizes; -- (void)deleteNodesAtIndexPaths:(NSArray *)indexPaths; +- (void)deleteNodesAtIndexPaths:(NSArray *)indexPaths; -- (void)insertSections:(NSArray *)sections atIndexSet:(NSIndexSet *)indexSet; +- (void)insertSections:(NSArray*> *)sections atIndexSet:(NSIndexSet *)indexSet; - (void)deleteSectionsAtIndexSet:(NSIndexSet *)indexSet; -- (void)setVisibleNodeIndexPaths:(NSArray *)indexPaths; +- (void)setVisibleNodeIndexPaths:(NSArray *)indexPaths; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h b/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h index 99d7c9adb3..4df67ada23 100644 --- a/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h +++ b/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h @@ -8,6 +8,7 @@ #import +NS_ASSUME_NONNULL_BEGIN /* * Use this class to compose new attributed strings. You may use the normal @@ -38,14 +39,14 @@ */ @interface ASMutableAttributedStringBuilder : NSMutableAttributedString -- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary *)attrs; +- (instancetype)initWithString:(NSString *)str attributes:(nullable NSDictionary *)attrs; - (instancetype)initWithAttributedString:(NSAttributedString *)attrStr; - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)str; -- (void)setAttributes:(NSDictionary *)attrs range:(NSRange)range; +- (void)setAttributes:(nullable NSDictionary *)attrs range:(NSRange)range; - (void)addAttribute:(NSString *)name value:(id)value range:(NSRange)range; -- (void)addAttributes:(NSDictionary *)attrs range:(NSRange)range; +- (void)addAttributes:(NSDictionary *)attrs range:(NSRange)range; - (void)removeAttribute:(NSString *)name range:(NSRange)range; - (void)replaceCharactersInRange:(NSRange)range withAttributedString:(NSAttributedString *)attrString; @@ -57,3 +58,5 @@ - (NSMutableAttributedString *)composedAttributedString; @end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/ASRangeController.h b/AsyncDisplayKit/Details/ASRangeController.h index 9d5bbe57f0..aaf67689d9 100644 --- a/AsyncDisplayKit/Details/ASRangeController.h +++ b/AsyncDisplayKit/Details/ASRangeController.h @@ -13,6 +13,7 @@ #import #import +NS_ASSUME_NONNULL_BEGIN @protocol ASRangeControllerDelegate; @@ -65,7 +66,7 @@ * * @returns an array of index paths corresponding to the nodes currently visible onscreen (i.e., the visible range). */ -- (NSArray *)rangeControllerVisibleNodeIndexPaths:(ASRangeController *)rangeController; +- (NSArray *)rangeControllerVisibleNodeIndexPaths:(ASRangeController *)rangeController; /** * @param rangeController Sender. @@ -88,7 +89,7 @@ * @param animated NO if all animations are disabled. YES otherwise. * @param completion Completion block. */ -- (void)rangeController:(ASRangeController * )rangeController endUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL))completion; +- (void)rangeController:(ASRangeController * )rangeController endUpdatesAnimated:(BOOL)animated completion:(void (^ _Nullable)(BOOL))completion; /** * Fetch nodes at specific index paths. @@ -97,7 +98,7 @@ * * @param indexPaths Index paths. */ -- (NSArray *)rangeController:(ASRangeController *)rangeController nodesAtIndexPaths:(NSArray *)indexPaths; +- (NSArray *)rangeController:(ASRangeController *)rangeController nodesAtIndexPaths:(NSArray *)indexPaths; /** * Called for nodes insertion. @@ -110,7 +111,7 @@ * * @param animationOptions Animation options. See ASDataControllerAnimationOptions. */ -- (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; /** * Called for nodes deletion. @@ -123,7 +124,7 @@ * * @param animationOptions Animation options. See ASDataControllerAnimationOptions. */ -- (void)rangeController:(ASRangeController *)rangeController didDeleteNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; +- (void)rangeController:(ASRangeController *)rangeController didDeleteNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; /** * Called for section insertion. @@ -148,3 +149,5 @@ - (void)rangeController:(ASRangeController *)rangeController didDeleteSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions; @end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/ASRangeHandler.h b/AsyncDisplayKit/Details/ASRangeHandler.h index 22a7c564a5..136736f442 100644 --- a/AsyncDisplayKit/Details/ASRangeHandler.h +++ b/AsyncDisplayKit/Details/ASRangeHandler.h @@ -10,6 +10,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + @class ASDisplayNode; @protocol ASRangeHandler @@ -20,3 +22,5 @@ - (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType; @end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/ASRangeHandlerPreload.h b/AsyncDisplayKit/Details/ASRangeHandlerPreload.h index 7dc0113883..eb7c34f991 100644 --- a/AsyncDisplayKit/Details/ASRangeHandlerPreload.h +++ b/AsyncDisplayKit/Details/ASRangeHandlerPreload.h @@ -10,6 +10,10 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface ASRangeHandlerPreload : NSObject @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASRangeHandlerRender.h b/AsyncDisplayKit/Details/ASRangeHandlerRender.h index b064cb6abf..8b00982b99 100644 --- a/AsyncDisplayKit/Details/ASRangeHandlerRender.h +++ b/AsyncDisplayKit/Details/ASRangeHandlerRender.h @@ -10,6 +10,10 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface ASRangeHandlerRender : NSObject @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASScrollDirection.h b/AsyncDisplayKit/Details/ASScrollDirection.h index a46295cf9e..2d75703d69 100644 --- a/AsyncDisplayKit/Details/ASScrollDirection.h +++ b/AsyncDisplayKit/Details/ASScrollDirection.h @@ -10,6 +10,8 @@ #import "ASBaseDefines.h" +NS_ASSUME_NONNULL_BEGIN + typedef NS_OPTIONS(NSInteger, ASScrollDirection) { ASScrollDirectionNone = 0, ASScrollDirectionRight = 1 << 0, @@ -32,3 +34,5 @@ BOOL ASScrollDirectionContainsUp(ASScrollDirection scrollDirection); BOOL ASScrollDirectionContainsDown(ASScrollDirection scrollDirection); ASDISPLAYNODE_EXTERN_C_END + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASTextNodeCoreTextAdditions.h b/AsyncDisplayKit/Details/ASTextNodeCoreTextAdditions.h index ce74957e22..d16aa90256 100644 --- a/AsyncDisplayKit/Details/ASTextNodeCoreTextAdditions.h +++ b/AsyncDisplayKit/Details/ASTextNodeCoreTextAdditions.h @@ -11,6 +11,7 @@ #import +NS_ASSUME_NONNULL_BEGIN ASDISPLAYNODE_EXTERN_C_BEGIN /** @@ -81,3 +82,5 @@ ASDISPLAYNODE_EXTERN_C_END + (instancetype)paragraphStyleWithCTParagraphStyle:(CTParagraphStyleRef)coreTextParagraphStyle; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASTextNodeRenderer.h b/AsyncDisplayKit/Details/ASTextNodeRenderer.h index 3b80bb1677..dd5804e233 100644 --- a/AsyncDisplayKit/Details/ASTextNodeRenderer.h +++ b/AsyncDisplayKit/Details/ASTextNodeRenderer.h @@ -8,6 +8,7 @@ #import +NS_ASSUME_NONNULL_BEGIN typedef void (^as_renderer_index_block_t)(NSUInteger characterIndex, CGRect glyphBoundingRect, @@ -46,10 +47,10 @@ typedef NS_ENUM(NSUInteger, ASTextNodeRendererMeasureOption) { @interface ASTextNodeRenderer : NSObject - (instancetype)initWithAttributedString:(NSAttributedString *)attributedString - truncationString:(NSAttributedString *)truncationString + truncationString:(nullable NSAttributedString *)truncationString truncationMode:(NSLineBreakMode)truncationMode maximumLineCount:(NSUInteger)maximumLineCount - exclusionPaths:(NSArray *)exclusionPaths + exclusionPaths:(nullable NSArray *)exclusionPaths constrainedSize:(CGSize)constrainedSize; /* * Designated Initializer @@ -59,7 +60,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeRendererMeasureOption) { * so feel free */ - (instancetype)initWithAttributedString:(NSAttributedString *)attributedString - truncationString:(NSAttributedString *)truncationString + truncationString:(nullable NSAttributedString *)truncationString truncationMode:(NSLineBreakMode)truncationMode maximumLineCount:(NSUInteger)maximumLineCount constrainedSize:(CGSize)constrainedSize; @@ -129,7 +130,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeRendererMeasureOption) { * * Triggers initialization of textkit components, truncation, and sizing. */ -- (NSArray *)rectsForTextRange:(NSRange)textRange +- (NSArray *)rectsForTextRange:(NSRange)textRange measureOption:(ASTextNodeRendererMeasureOption)measureOption; /* @@ -186,3 +187,5 @@ typedef NS_ENUM(NSUInteger, ASTextNodeRendererMeasureOption) { - (NSUInteger)lineCount; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASTextNodeShadower.h b/AsyncDisplayKit/Details/ASTextNodeShadower.h index 59744897cc..3b0adca3f1 100644 --- a/AsyncDisplayKit/Details/ASTextNodeShadower.h +++ b/AsyncDisplayKit/Details/ASTextNodeShadower.h @@ -9,6 +9,7 @@ #import #import +NS_ASSUME_NONNULL_BEGIN /** * @abstract Negates/inverts a UIEdgeInsets. @@ -67,3 +68,5 @@ static inline UIEdgeInsets ASDNEdgeInsetsInvert(UIEdgeInsets insets) - (void)setShadowInContext:(CGContextRef)context; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASTextNodeTextKitHelpers.h b/AsyncDisplayKit/Details/ASTextNodeTextKitHelpers.h index 22fc9efb08..d51dab0f5b 100644 --- a/AsyncDisplayKit/Details/ASTextNodeTextKitHelpers.h +++ b/AsyncDisplayKit/Details/ASTextNodeTextKitHelpers.h @@ -11,6 +11,7 @@ #import #import +NS_ASSUME_NONNULL_BEGIN @interface ASTextKitComponents : NSObject @@ -21,7 +22,7 @@ @return An `ASTextKitComponents` containing the created components. The text view component will be nil. @discussion The returned components will be hooked up together, so they are ready for use as a system upon return. */ -+ (ASTextKitComponents *)componentsWithAttributedSeedString:(NSAttributedString *)attributedSeedString ++ (ASTextKitComponents *)componentsWithAttributedSeedString:(nullable NSAttributedString *)attributedSeedString textContainerSize:(CGSize)textContainerSize; /** @@ -35,6 +36,8 @@ @property (nonatomic, strong, readonly) NSTextStorage *textStorage; @property (nonatomic, strong, readonly) NSTextContainer *textContainer; @property (nonatomic, strong, readonly) NSLayoutManager *layoutManager; -@property (nonatomic, strong) UITextView *textView; +@property (nullable, nonatomic, strong) UITextView *textView; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASTextNodeWordKerner.h b/AsyncDisplayKit/Details/ASTextNodeWordKerner.h index 1be6390c31..a98654cf27 100644 --- a/AsyncDisplayKit/Details/ASTextNodeWordKerner.h +++ b/AsyncDisplayKit/Details/ASTextNodeWordKerner.h @@ -9,6 +9,7 @@ #import #import +NS_ASSUME_NONNULL_BEGIN /** @abstract This class acts as the NSLayoutManagerDelegate for ASTextNode. @@ -28,3 +29,5 @@ */ @end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/CGRect+ASConvenience.h b/AsyncDisplayKit/Details/CGRect+ASConvenience.h index a9cc714a31..9743eb49a0 100644 --- a/AsyncDisplayKit/Details/CGRect+ASConvenience.h +++ b/AsyncDisplayKit/Details/CGRect+ASConvenience.h @@ -10,9 +10,13 @@ #import "ASBaseDefines.h" +NS_ASSUME_NONNULL_BEGIN + ASDISPLAYNODE_EXTERN_C_BEGIN CGRect asdk_CGRectExpandHorizontally(CGRect rect, CGFloat negativeMultiplier, CGFloat positiveMultiplier); CGRect asdk_CGRectExpandVertically(CGRect rect, CGFloat negativeMultiplier, CGFloat positiveMultiplier); ASDISPLAYNODE_EXTERN_C_END + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h b/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h index 8810ba3524..cd2dd1eb47 100644 --- a/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h +++ b/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h @@ -8,6 +8,7 @@ #import +NS_ASSUME_NONNULL_BEGIN @interface NSMutableAttributedString (TextKitAdditions) @@ -20,3 +21,5 @@ - (void)attributeTextInRange:(NSRange)range withTextKitParagraphStyle:(NSParagraphStyle *)paragraphStyle; @end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h b/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h index 1853be6fb7..4710cbdf4b 100644 --- a/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h +++ b/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h @@ -8,8 +8,12 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface UICollectionViewLayout (ASConvenience) - (BOOL)asdk_isFlowLayout; @end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/UIView+ASConvenience.h b/AsyncDisplayKit/Details/UIView+ASConvenience.h index d1f0032469..dfd59167b7 100644 --- a/AsyncDisplayKit/Details/UIView+ASConvenience.h +++ b/AsyncDisplayKit/Details/UIView+ASConvenience.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + /** These are the properties we support from CALayer (implemented in the pending state) @@ -18,7 +20,7 @@ @property (nonatomic, assign) CGPoint position; @property (nonatomic, assign) CGFloat zPosition; @property (nonatomic, assign) CGPoint anchorPoint; -@property (nonatomic, retain) id contents; +@property (nullable, nonatomic, retain) id contents; @property (nonatomic, assign) CGFloat cornerRadius; @property (nonatomic, assign) CGFloat contentsScale; @property (nonatomic, assign) CATransform3D transform; @@ -30,9 +32,9 @@ @property (nonatomic, assign) CGFloat shadowRadius; @property (nonatomic, assign) CGFloat borderWidth; @property (nonatomic, assign, getter = isOpaque) BOOL opaque; -@property (nonatomic, retain) __attribute__((NSObject)) CGColorRef borderColor; -@property (nonatomic, copy) NSString *asyncdisplaykit_name; -@property (nonatomic, retain) __attribute__((NSObject)) CGColorRef backgroundColor; +@property (nullable, nonatomic, retain) __attribute__((NSObject)) CGColorRef borderColor; +@property (nullable, nonatomic, copy) NSString *asyncdisplaykit_name; +@property (nullable, nonatomic, retain) __attribute__((NSObject)) CGColorRef backgroundColor; @property (nonatomic, assign) BOOL allowsEdgeAntialiasing; @property (nonatomic, assign) unsigned int edgeAntialiasingMask; @@ -50,7 +52,7 @@ @property (nonatomic, getter=isHidden) BOOL hidden; @property (nonatomic, assign) BOOL autoresizesSubviews; @property (nonatomic, assign) UIViewAutoresizing autoresizingMask; -@property (nonatomic, retain) UIColor *tintColor; +@property (nonatomic, retain, null_resettable) UIColor *tintColor; @property (nonatomic, assign) CGFloat alpha; @property (nonatomic, assign) CGRect bounds; @property (nonatomic, assign) UIViewContentMode contentMode; @@ -76,10 +78,12 @@ */ // Accessibility identification support -@property (nonatomic, copy) NSString *accessibilityIdentifier; +@property (nullable, nonatomic, copy) NSString *accessibilityIdentifier; @end @interface CALayer (ASDisplayNodeLayer) -@property (atomic, copy) NSString *asyncdisplaykit_name; +@property (nullable, atomic, copy) NSString *asyncdisplaykit_name; @end + +NS_ASSUME_NONNULL_END