diff --git a/src/core/src/NIActions+Subclassing.h b/src/core/src/NIActions+Subclassing.h index ff397bce0..236d1c57f 100644 --- a/src/core/src/NIActions+Subclassing.h +++ b/src/core/src/NIActions+Subclassing.h @@ -18,20 +18,20 @@ @interface NIObjectActions : NSObject -@property (nonatomic, copy) NIActionBlock tapAction; -@property (nonatomic, copy) NIActionBlock detailAction; -@property (nonatomic, copy) NIActionBlock navigateAction; +@property (nonatomic, copy, nullable) NIActionBlock tapAction; +@property (nonatomic, copy, nullable) NIActionBlock detailAction; +@property (nonatomic, copy, nullable) NIActionBlock navigateAction; -@property (nonatomic) SEL tapSelector; -@property (nonatomic) SEL detailSelector; -@property (nonatomic) SEL navigateSelector; +@property (nonatomic, nullable) SEL tapSelector; +@property (nonatomic, nullable) SEL detailSelector; +@property (nonatomic, nullable) SEL navigateSelector; @end @interface NIActions () -@property (nonatomic, weak) id target; +@property (nonatomic, weak, nullable) id target; -- (NIObjectActions *)actionForObjectOrClassOfObject:(id)object; +- (nullable NIObjectActions *)actionForObjectOrClassOfObject:(nonnull id)object; @end diff --git a/src/core/src/NIActions.h b/src/core/src/NIActions.h index 460ec3624..c8459f43c 100644 --- a/src/core/src/NIActions.h +++ b/src/core/src/NIActions.h @@ -29,7 +29,7 @@ * @param target The target that was attached to the NIActions instance. * @param indexPath The index path of the object. */ -typedef BOOL (^NIActionBlock)(id object, id target, NSIndexPath* indexPath); +typedef BOOL (^NIActionBlock)(_Nonnull id object, _Nullable id target, NSIndexPath* _Nonnull indexPath); /** * The attachable types of actions for NIAction. @@ -92,34 +92,34 @@ NSArray *objects = @[ @interface NIActions : NSObject // Designated initializer. -- (id)initWithTarget:(id)target; +- (nonnull id)initWithTarget:(nullable id)target; #pragma mark Mapping Objects -- (id)attachToObject:(id)object tapBlock:(NIActionBlock)action; -- (id)attachToObject:(id)object detailBlock:(NIActionBlock)action; -- (id)attachToObject:(id)object navigationBlock:(NIActionBlock)action; +- (nonnull id)attachToObject:(nonnull id)object tapBlock:(nonnull NIActionBlock)action; +- (nonnull id)attachToObject:(nonnull id)object detailBlock:(nonnull NIActionBlock)action; +- (nonnull id)attachToObject:(nonnull id)object navigationBlock:(nonnull NIActionBlock)action; -- (id)attachToObject:(id)object tapSelector:(SEL)selector; -- (id)attachToObject:(id)object detailSelector:(SEL)selector; -- (id)attachToObject:(id)object navigationSelector:(SEL)selector; +- (nonnull id)attachToObject:(nonnull id)object tapSelector:(nonnull SEL)selector; +- (nonnull id)attachToObject:(nonnull id)object detailSelector:(nonnull SEL)selector; +- (nonnull id)attachToObject:(nonnull id)object navigationSelector:(nonnull SEL)selector; #pragma mark Mapping Classes -- (void)attachToClass:(Class)aClass tapBlock:(NIActionBlock)action; -- (void)attachToClass:(Class)aClass detailBlock:(NIActionBlock)action; -- (void)attachToClass:(Class)aClass navigationBlock:(NIActionBlock)action; +- (void)attachToClass:(nonnull Class)aClass tapBlock:(nonnull NIActionBlock)action; +- (void)attachToClass:(nonnull Class)aClass detailBlock:(nonnull NIActionBlock)action; +- (void)attachToClass:(nonnull Class)aClass navigationBlock:(nonnull NIActionBlock)action; -- (void)attachToClass:(Class)aClass tapSelector:(SEL)selector; -- (void)attachToClass:(Class)aClass detailSelector:(SEL)selector; -- (void)attachToClass:(Class)aClass navigationSelector:(SEL)selector; +- (void)attachToClass:(nonnull Class)aClass tapSelector:(nonnull SEL)selector; +- (void)attachToClass:(nonnull Class)aClass detailSelector:(nonnull SEL)selector; +- (void)attachToClass:(nonnull Class)aClass navigationSelector:(nonnull SEL)selector; #pragma mark Object State -- (BOOL)isObjectActionable:(id)object; -- (NIActionType)attachedActionTypesForObject:(id)object; +- (BOOL)isObjectActionable:(nonnull id)object; +- (NIActionType)attachedActionTypesForObject:(nonnull id)object; -+ (id)objectFromKeyClass:(Class)keyClass map:(NSMutableDictionary *)map; ++ (nullable id)objectFromKeyClass:(nonnull Class)keyClass map:(nonnull NSMutableDictionary *)map; @end @@ -137,7 +137,7 @@ extern "C" { * * @param controllerClass The class of controller to instantiate. */ -NIActionBlock NIPushControllerAction(Class controllerClass); +_Nonnull NIActionBlock NIPushControllerAction(_Nonnull Class controllerClass); #if defined __cplusplus } @@ -151,7 +151,7 @@ NIActionBlock NIPushControllerAction(Class controllerClass); * * @param indexPath The index path of the requested object. */ -- (id)objectAtIndexPath:(NSIndexPath *)indexPath; +- (nullable id)objectAtIndexPath:(nonnull NSIndexPath *)indexPath; @end