diff --git a/AsyncDisplayKit/ASButtonNode.h b/AsyncDisplayKit/ASButtonNode.h index 8b2b35e5a0..68aaf4b509 100644 --- a/AsyncDisplayKit/ASButtonNode.h +++ b/AsyncDisplayKit/ASButtonNode.h @@ -11,6 +11,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + /** Image alignment defines where the image will be placed relative to the text. */ @@ -23,9 +25,9 @@ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) { @interface ASButtonNode : ASControlNode -@property (nonatomic, readonly) ASTextNode * _Nonnull titleNode; -@property (nonatomic, readonly) ASImageNode * _Nonnull imageNode; -@property (nonatomic, readonly) ASImageNode * _Nonnull backgroundImageNode; +@property (nonatomic, readonly) ASTextNode * titleNode; +@property (nonatomic, readonly) ASImageNode * imageNode; +@property (nonatomic, readonly) ASImageNode * backgroundImageNode; /** Spacing between image and title. Defaults to 8.0. @@ -85,7 +87,7 @@ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) { * @param color The color to use for the title. * @param state The state that uses the specified title. The possible values are described in ASControlState. */ -- (void)setTitle:(nonnull NSString *)title withFont:(nullable UIFont *)font withColor:(nullable UIColor *)color forState:(ASControlState)state; +- (void)setTitle:(NSString *)title withFont:(nullable UIFont *)font withColor:(nullable UIColor *)color forState:(ASControlState)state; #endif /** * Returns the image used for a button state. @@ -94,7 +96,7 @@ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) { * * @return The image used for the specified state. */ -- (UIImage * _Nullable)imageForState:(ASControlState)state; +- (nullable UIImage *)imageForState:(ASControlState)state; /** * Sets the image to use for the specified state. @@ -120,6 +122,8 @@ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) { * * @return The background image used for the specified state. */ -- (UIImage * _Nullable)backgroundImageForState:(ASControlState)state; +- (nullable UIImage *)backgroundImageForState:(ASControlState)state; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASDisplayNode.h b/AsyncDisplayKit/ASDisplayNode.h index 043a223f29..2fe4b504f1 100644 --- a/AsyncDisplayKit/ASDisplayNode.h +++ b/AsyncDisplayKit/ASDisplayNode.h @@ -18,6 +18,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + #define ASDisplayNodeLoggingEnabled 0 @class ASDisplayNode; @@ -40,12 +42,12 @@ typedef CALayer * _Nonnull(^ASDisplayNodeLayerBlock)(); /** * ASDisplayNode loaded callback block. This block is called BEFORE the -didLoad method and is always called on the main thread. */ -typedef void (^ASDisplayNodeDidLoadBlock)(__kindof ASDisplayNode * _Nonnull node); +typedef void (^ASDisplayNodeDidLoadBlock)(__kindof ASDisplayNode * node); /** * ASDisplayNode will / did render node content in context. */ -typedef void (^ASDisplayNodeContextModifier)(_Nonnull CGContextRef context); +typedef void (^ASDisplayNodeContextModifier)(CGContextRef context); /** * ASDisplayNode layout spec block. This block can be used instead of implementing layoutSpecThatFits: in subclass @@ -102,7 +104,6 @@ extern NSInteger const ASDefaultDrawingPriority; * */ -NS_ASSUME_NONNULL_BEGIN @interface ASDisplayNode : ASDealloc2MainObject diff --git a/AsyncDisplayKit/ASImageNode.h b/AsyncDisplayKit/ASImageNode.h index 141036a9ff..2bba89d709 100644 --- a/AsyncDisplayKit/ASImageNode.h +++ b/AsyncDisplayKit/ASImageNode.h @@ -11,6 +11,7 @@ #import #import "ASImageProtocols.h" +#import "ASBaseDefines.h" NS_ASSUME_NONNULL_BEGIN @@ -120,7 +121,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image); * `displaySuspended` is YES, `displayCompletionBlock` is will be * performed immediately and `YES` will be passed for `canceled`. */ -- (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))displayCompletionBlock; +- (void)setNeedsDisplayWithCompletion:(nullable void (^)(BOOL canceled))displayCompletionBlock; #if TARGET_OS_TV /** @@ -164,9 +165,9 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image); @interface ASImageNode (Unavailable) -- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable; +- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock AS_UNAVAILABLE(); -- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable; +- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock AS_UNAVAILABLE(); @end diff --git a/AsyncDisplayKit/ASNavigationController.h b/AsyncDisplayKit/ASNavigationController.h index 0c82241894..cb5f80ba4f 100644 --- a/AsyncDisplayKit/ASNavigationController.h +++ b/AsyncDisplayKit/ASNavigationController.h @@ -14,6 +14,10 @@ #import "ASVisibilityProtocols.h" +NS_ASSUME_NONNULL_BEGIN + @interface ASNavigationController : UINavigationController @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASPagerFlowLayout.h b/AsyncDisplayKit/ASPagerFlowLayout.h index 63b1d0d186..af5344e16a 100644 --- a/AsyncDisplayKit/ASPagerFlowLayout.h +++ b/AsyncDisplayKit/ASPagerFlowLayout.h @@ -12,6 +12,10 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface ASPagerFlowLayout : UICollectionViewFlowLayout @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASTabBarController.h b/AsyncDisplayKit/ASTabBarController.h index b07b70ba80..05f345ec2d 100644 --- a/AsyncDisplayKit/ASTabBarController.h +++ b/AsyncDisplayKit/ASTabBarController.h @@ -14,6 +14,10 @@ #import "ASVisibilityProtocols.h" +NS_ASSUME_NONNULL_BEGIN + @interface ASTabBarController : UITabBarController @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASTableNode.h b/AsyncDisplayKit/ASTableNode.h index eb446a6cf3..cd163a58cb 100644 --- a/AsyncDisplayKit/ASTableNode.h +++ b/AsyncDisplayKit/ASTableNode.h @@ -14,6 +14,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + @protocol ASTableDataSource; @protocol ASTableDelegate; @class ASTableView; @@ -34,3 +36,5 @@ @property (weak, nonatomic) id dataSource; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASTextNode+Beta.h b/AsyncDisplayKit/ASTextNode+Beta.h index 91ea9a585f..130daa9360 100644 --- a/AsyncDisplayKit/ASTextNode+Beta.h +++ b/AsyncDisplayKit/ASTextNode+Beta.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @abstract An array of descending scale factors that will be applied to this text node to try to make it fit within its constrained size @default nil (no scaling) */ -@property (nullable, nonatomic, copy) NSArray *pointSizeScaleFactors; +@property (nullable, nonatomic, copy) NSArray *pointSizeScaleFactors; /** @abstract Text margins for text laid out in the text node. diff --git a/AsyncDisplayKit/ASVisibilityProtocols.h b/AsyncDisplayKit/ASVisibilityProtocols.h index 8193b76dc8..e78f13266a 100644 --- a/AsyncDisplayKit/ASVisibilityProtocols.h +++ b/AsyncDisplayKit/ASVisibilityProtocols.h @@ -14,6 +14,8 @@ #import "ASBaseDefines.h" +NS_ASSUME_NONNULL_BEGIN + @class UIViewController; ASDISPLAYNODE_EXTERN_C_BEGIN @@ -106,3 +108,5 @@ ASDISPLAYNODE_EXTERN_C_END _parentManagesVisibilityDepth = NO; \ [self visibilityDepthDidChange]; \ } + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/AsyncDisplayKit+Debug.h b/AsyncDisplayKit/AsyncDisplayKit+Debug.h index eec60c9001..5f6aa72d31 100644 --- a/AsyncDisplayKit/AsyncDisplayKit+Debug.h +++ b/AsyncDisplayKit/AsyncDisplayKit+Debug.h @@ -14,6 +14,8 @@ #import "ASImageNode.h" #import "ASRangeController.h" +NS_ASSUME_NONNULL_BEGIN + @interface ASImageNode (Debugging) /** @@ -67,3 +69,4 @@ @end +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASCollectionInternal.h b/AsyncDisplayKit/Details/ASCollectionInternal.h index 703409b075..99b3f50247 100644 --- a/AsyncDisplayKit/Details/ASCollectionInternal.h +++ b/AsyncDisplayKit/Details/ASCollectionInternal.h @@ -12,15 +12,19 @@ #import +NS_ASSUME_NONNULL_BEGIN + @protocol ASCollectionViewLayoutFacilitatorProtocol; @class ASCollectionNode; @class ASDataController; @class ASRangeController; @interface ASCollectionView () -- (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(id)layoutFacilitator ownedByNode:(BOOL)ownedByNode; +- (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(nullable id)layoutFacilitator ownedByNode:(BOOL)ownedByNode; @property (nonatomic, weak, readwrite) ASCollectionNode *collectionNode; @property (nonatomic, strong, readonly) ASDataController *dataController; @property (nonatomic, strong, readonly) ASRangeController *rangeController; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/UIImage+ASConvenience.h b/AsyncDisplayKit/UIImage+ASConvenience.h index 092bdbcd55..88a6f4196d 100644 --- a/AsyncDisplayKit/UIImage+ASConvenience.h +++ b/AsyncDisplayKit/UIImage+ASConvenience.h @@ -13,9 +13,11 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + // High-performance flat-colored, rounded-corner resizable images // -// For "Baked-in Opaque" corners, set cornerColor equal to the color behind the rounded image object, e.g. the background color. +// For "Baked-in Opaque" corners, set cornerColor equal to the color behind the rounded image object, i.e. the background color. // For "Baked-in Alpha" corners, set cornerColor = [UIColor clearColor] // // See http://asyncdisplaykit.org/docs/corner-rounding.html for an explanation. @@ -45,7 +47,7 @@ + (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius cornerColor:(UIColor *)cornerColor fillColor:(UIColor *)fillColor - borderColor:(UIColor *)borderColor + borderColor:(nullable UIColor *)borderColor borderWidth:(CGFloat)borderWidth; /** @@ -62,10 +64,11 @@ + (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius cornerColor:(UIColor *)cornerColor fillColor:(UIColor *)fillColor - borderColor:(UIColor *)borderColor + borderColor:(nullable UIColor *)borderColor borderWidth:(CGFloat)borderWidth roundedCorners:(UIRectCorner)roundedCorners scale:(CGFloat)scale; @end +NS_ASSUME_NONNULL_END