diff --git a/BlocksKit/Core/NSArray+BlocksKit.h b/BlocksKit/Core/NSArray+BlocksKit.h index 8eeb8869c..68dff9c8a 100644 --- a/BlocksKit/Core/NSArray+BlocksKit.h +++ b/BlocksKit/Core/NSArray+BlocksKit.h @@ -7,6 +7,8 @@ #import #import // for CGFloat +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSArray. Both inspired by and resembling Smalltalk syntax, these utilities @@ -55,7 +57,7 @@ @return Returns the object, if found, or `nil`. @see bk_select: */ -- (id)bk_match:(BOOL (^)(id obj))block; +- (nullable id)bk_match:(BOOL (^)(id obj))block; /** Loops through an array to find the objects matching the block. @@ -117,7 +119,7 @@ @param block A block that takes the current sum and the next object to return the new sum. @return An accumulated value. */ -- (id)bk_reduce:(id)initial withBlock:(id (^)(id sum, id obj))block; +- (nullable id)bk_reduce:(nullable id)initial withBlock:(__nullable id (^)(__nullable id sum, id obj))block; /** Sometimes we just want to loop an objects list and reduce one property, where @@ -219,3 +221,5 @@ - (BOOL)bk_corresponds:(NSArray *)list withBlock:(BOOL (^)(id obj1, id obj2))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSDictionary+BlocksKit.h b/BlocksKit/Core/NSDictionary+BlocksKit.h index a36426d41..7537db094 100644 --- a/BlocksKit/Core/NSDictionary+BlocksKit.h +++ b/BlocksKit/Core/NSDictionary+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extension for NSDictionary. Both inspired by and resembling Smalltalk syntax, this utility @@ -49,7 +51,7 @@ @param block A BOOL-returning code block for a key/value pair. @return The value of the first pair found; */ -- (id)bk_match:(BOOL (^)(id key, id obj))block; +- (nullable id)bk_match:(BOOL (^)(id key, id obj))block; /** Loops through a dictionary to find the key/value pairs matching the block. @@ -109,3 +111,5 @@ - (BOOL)bk_all:(BOOL (^)(id key, id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSIndexSet+BlocksKit.h b/BlocksKit/Core/NSIndexSet+BlocksKit.h index 5ed684fa2..f29265cc5 100644 --- a/BlocksKit/Core/NSIndexSet+BlocksKit.h +++ b/BlocksKit/Core/NSIndexSet+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSIndexSet. Both inspired by and resembling Smalltalk syntax, these utilities @@ -118,3 +120,5 @@ - (BOOL)bk_none:(BOOL (^)(NSUInteger index))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSInvocation+BlocksKit.h b/BlocksKit/Core/NSInvocation+BlocksKit.h index 7812c264e..5ca423157 100644 --- a/BlocksKit/Core/NSInvocation+BlocksKit.h +++ b/BlocksKit/Core/NSInvocation+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** BlocksKit extensions for NSInvocation. */ @interface NSInvocation (BlocksKit) @@ -32,3 +34,5 @@ + (NSInvocation *)bk_invocationWithTarget:(id)target block:(void (^)(id target))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSMapTable+BlocksKit.h b/BlocksKit/Core/NSMapTable+BlocksKit.h index c6a4e2cdc..4bd6b9ab5 100644 --- a/BlocksKit/Core/NSMapTable+BlocksKit.h +++ b/BlocksKit/Core/NSMapTable+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + @interface NSMapTable (BlocksKit) /** Loops through the maptable and executes the given block using each item. @@ -22,7 +24,7 @@ @param block A BOOL-returning code block for a key/value pair. @return The value of the first pair found; */ -- (id)bk_match:(BOOL (^)(id key, id obj))block; +- (nullable id)bk_match:(BOOL (^)(id key, id obj))block; /** Loops through a maptable to find the key/value pairs matching the block. @@ -105,3 +107,5 @@ - (void)bk_performMap:(id (^)(id key, id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSMutableArray+BlocksKit.h b/BlocksKit/Core/NSMutableArray+BlocksKit.h index 18c5e219c..ed69bdda1 100644 --- a/BlocksKit/Core/NSMutableArray+BlocksKit.h +++ b/BlocksKit/Core/NSMutableArray+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSMutableArray. These utilities expound upon the BlocksKit additions to the immutable @@ -49,3 +51,5 @@ - (void)bk_performMap:(id (^)(id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSMutableDictionary+BlocksKit.h b/BlocksKit/Core/NSMutableDictionary+BlocksKit.h index 350eae906..6a0a1d6ef 100644 --- a/BlocksKit/Core/NSMutableDictionary+BlocksKit.h +++ b/BlocksKit/Core/NSMutableDictionary+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSMutableDictionary. These utilities expound upon the BlocksKit additions to the immutable @@ -45,3 +47,5 @@ - (void)bk_performMap:(id (^)(id key, id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSMutableIndexSet+BlocksKit.h b/BlocksKit/Core/NSMutableIndexSet+BlocksKit.h index fcd222cb9..66c476325 100644 --- a/BlocksKit/Core/NSMutableIndexSet+BlocksKit.h +++ b/BlocksKit/Core/NSMutableIndexSet+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSMutableIndexSet. These utilities expound upon the BlocksKit additions to the immutable @@ -41,3 +43,5 @@ @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSMutableOrderedSet+BlocksKit.h b/BlocksKit/Core/NSMutableOrderedSet+BlocksKit.h index 7e71d8c67..f96c98255 100644 --- a/BlocksKit/Core/NSMutableOrderedSet+BlocksKit.h +++ b/BlocksKit/Core/NSMutableOrderedSet+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSMutableOrderedSet. These utilities expound upon the BlocksKit additions to the immutable @@ -49,3 +51,5 @@ - (void)bk_performMap:(id (^)(id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSMutableSet+BlocksKit.h b/BlocksKit/Core/NSMutableSet+BlocksKit.h index 777faef27..8a474067b 100644 --- a/BlocksKit/Core/NSMutableSet+BlocksKit.h +++ b/BlocksKit/Core/NSMutableSet+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSMutableSet. These utilities expound upon the BlocksKit additions to the immutable @@ -49,3 +51,5 @@ - (void)bk_performMap:(id (^)(id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSObject+BKAssociatedObjects.h b/BlocksKit/Core/NSObject+BKAssociatedObjects.h index 53ca1b62c..1216ced1c 100644 --- a/BlocksKit/Core/NSObject+BKAssociatedObjects.h +++ b/BlocksKit/Core/NSObject+BKAssociatedObjects.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Objective-C wrapper for 10.6+ associated object API. In Mac OS X Snow Leopard and iOS 3.0, Apple introduced an addition to the @@ -37,7 +39,7 @@ @param value Any object. @param key A unique key pointer. */ -- (void)bk_associateValue:(id)value withKey:(const void *)key; +- (void)bk_associateValue:(nullable id)value withKey:(const void *)key; /** Strongly associates an object with the receiving class. @@ -45,7 +47,7 @@ @param value Any object. @param key A unique key pointer. */ -+ (void)bk_associateValue:(id)value withKey:(const void *)key; ++ (void)bk_associateValue:(nullable id)value withKey:(const void *)key; /** Strongly, thread-safely associates an object with the reciever. @@ -61,7 +63,7 @@ @param value Any object. @param key A unique key pointer. */ -- (void)bk_atomicallyAssociateValue:(id)value withKey:(const void *)key; +- (void)bk_atomicallyAssociateValue:(nullable id)value withKey:(const void *)key; /** Strongly, thread-safely associates an object with the receiving class. @@ -69,7 +71,7 @@ @param value Any object. @param key A unique key pointer. */ -+ (void)bk_atomicallyAssociateValue:(id)value withKey:(const void *)key; ++ (void)bk_atomicallyAssociateValue:(nullable id)value withKey:(const void *)key; /** Associates a copy of an object with the reciever. @@ -82,7 +84,7 @@ @param value Any object, pointer, or value. @param key A unique key pointer. */ -- (void)bk_associateCopyOfValue:(id)value withKey:(const void *)key; +- (void)bk_associateCopyOfValue:(nullable id)value withKey:(const void *)key; /** Associates a copy of an object with the receiving class. @@ -90,7 +92,7 @@ @param value Any object, pointer, or value. @param key A unique key pointer. */ -+ (void)bk_associateCopyOfValue:(id)value withKey:(const void *)key; ++ (void)bk_associateCopyOfValue:(nullable id)value withKey:(const void *)key; /** Thread-safely associates a copy of an object with the reciever. @@ -104,7 +106,7 @@ @param value Any object, pointer, or value. @param key A unique key pointer. */ -- (void)bk_atomicallyAssociateCopyOfValue:(id)value withKey:(const void *)key; +- (void)bk_atomicallyAssociateCopyOfValue:(nullable id)value withKey:(const void *)key; /** Thread-safely associates a copy of an object with the receiving class. @@ -112,7 +114,7 @@ @param value Any object, pointer, or value. @param key A unique key pointer. */ -+ (void)bk_atomicallyAssociateCopyOfValue:(id)value withKey:(const void *)key; ++ (void)bk_atomicallyAssociateCopyOfValue:(nullable id)value withKey:(const void *)key; /** Weakly associates an object with the reciever. @@ -123,7 +125,7 @@ @param value Any object. @param key A unique key pointer. */ -- (void)bk_weaklyAssociateValue:(__autoreleasing id)value withKey:(const void *)key; +- (void)bk_weaklyAssociateValue:(nullable __autoreleasing id)value withKey:(const void *)key; /** Weakly associates an object with the receiving class. @@ -131,14 +133,14 @@ @param value Any object. @param key A unique key pointer. */ -+ (void)bk_weaklyAssociateValue:(__autoreleasing id)value withKey:(const void *)key; ++ (void)bk_weaklyAssociateValue:(nullable __autoreleasing id)value withKey:(const void *)key; /** Returns the associated value for a key on the reciever. @param key A unique key pointer. @return The object associated with the key, or `nil` if not found. */ -- (id)bk_associatedValueForKey:(const void *)key; +- (nullable id)bk_associatedValueForKey:(const void *)key; /** Returns the associated value for a key on the receiving class. @@ -146,7 +148,7 @@ @param key A unique key pointer. @return The object associated with the key, or `nil` if not found. */ -+ (id)bk_associatedValueForKey:(const void *)key; ++ (nullable id)bk_associatedValueForKey:(const void *)key; /** Returns the reciever to a clean state by removing all associated objects, releasing them if necessary. */ @@ -157,3 +159,5 @@ + (void)bk_removeAllAssociatedObjects; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSObject+BKBlockExecution.h b/BlocksKit/Core/NSObject+BKBlockExecution.h index e1ae5bc90..9958f1183 100644 --- a/BlocksKit/Core/NSObject+BKBlockExecution.h +++ b/BlocksKit/Core/NSObject+BKBlockExecution.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block execution on *any* object. This category overhauls the `performSelector:` utilities on @@ -119,3 +121,5 @@ + (void)bk_cancelBlock:(id )block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSObject+BKBlockObservation.h b/BlocksKit/Core/NSObject+BKBlockObservation.h index 8f5942b35..e4842eda9 100644 --- a/BlocksKit/Core/NSObject+BKBlockObservation.h +++ b/BlocksKit/Core/NSObject+BKBlockObservation.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Blocks wrapper for key-value observation. In Mac OS X Panther, Apple introduced an API called "key-value @@ -136,3 +138,5 @@ - (void)bk_removeAllBlockObservers; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSOrderedSet+BlocksKit.h b/BlocksKit/Core/NSOrderedSet+BlocksKit.h index bf46c750a..2d8efa1f7 100644 --- a/BlocksKit/Core/NSOrderedSet+BlocksKit.h +++ b/BlocksKit/Core/NSOrderedSet+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSOrderedSet. Both inspired by and resembling Smalltalk syntax, these utilities allow for @@ -52,7 +54,7 @@ @return Returns the object, if found, or `nil`. @see bk_select: */ -- (id)bk_match:(BOOL (^)(id obj))block; +- (nullable id)bk_match:(BOOL (^)(id obj))block; /** Loops through an ordered set to find the objects matching the block. @@ -109,7 +111,7 @@ @param block A block that takes the current sum and the next object to return the new sum. @return An accumulated value. */ -- (id)bk_reduce:(id)initial withBlock:(id (^)(id sum, id obj))block; +- (nullable id)bk_reduce:(nullable id)initial withBlock:(__nullable id (^)(__nullable id sum, id obj))block; /** Loops through an ordered set to find whether any object matches the block. @@ -167,3 +169,5 @@ */ - (BOOL)bk_corresponds:(NSOrderedSet *)list withBlock:(BOOL (^)(id obj1, id obj2))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSSet+BlocksKit.h b/BlocksKit/Core/NSSet+BlocksKit.h index cac218d36..ca540fcdf 100644 --- a/BlocksKit/Core/NSSet+BlocksKit.h +++ b/BlocksKit/Core/NSSet+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block extensions for NSSet. Both inspired by and resembling Smalltalk syntax, these utilities allows for @@ -51,7 +53,7 @@ @return Returns the object if found, `nil` otherwise. @see bk_select: */ -- (id)bk_match:(BOOL (^)(id obj))block; +- (nullable id)bk_match:(BOOL (^)(id obj))block; /** Loops through a set to find the objects matching the block. @@ -101,7 +103,7 @@ @param block A block that takes the current sum and the next object to return the new sum. @return An accumulated value. */ -- (id)bk_reduce:(id)initial withBlock:(id (^)(id sum, id obj))block; +- (nullable id)bk_reduce:(nullable id)initial withBlock:(__nullable id (^)(__nullable id sum, id obj))block; /** Loops through a set to find whether any object matches the block. @@ -132,3 +134,5 @@ - (BOOL)bk_all:(BOOL (^)(id obj))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/Core/NSTimer+BlocksKit.h b/BlocksKit/Core/NSTimer+BlocksKit.h index dd2a8bf7e..2daa3b639 100644 --- a/BlocksKit/Core/NSTimer+BlocksKit.h +++ b/BlocksKit/Core/NSTimer+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Simple category on NSTimer to give it blocks capability. Created by [Jiva DeVoe](https://github.com/jivadevoe) as `NSTimer-Blocks`. @@ -40,3 +42,5 @@ + (instancetype)bk_timerWithTimeInterval:(NSTimeInterval)seconds block:(void (^)(NSTimer *timer))block repeats:(BOOL)repeats; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/DynamicDelegate/A2BlockInvocation.h b/BlocksKit/DynamicDelegate/A2BlockInvocation.h index fb5621e78..bce5293d6 100644 --- a/BlocksKit/DynamicDelegate/A2BlockInvocation.h +++ b/BlocksKit/DynamicDelegate/A2BlockInvocation.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /// If a block invocation is instiated with an invalid method signature, /// an `NSInvalidArgumentException` is thrown containing this key in the /// user info. @@ -34,7 +36,7 @@ extern NSString *const A2IncompatibleMethodSignatureKey; @param block An Objective-C block literal @return A method signature matching the declared prototype for the block */ -+ (NSMethodSignature *)methodSignatureForBlock:(id)block; ++ (nullable NSMethodSignature *)methodSignatureForBlock:(id)block; /** @name Creating A2BlockInvocation Objects */ @@ -86,7 +88,7 @@ extern NSString *const A2IncompatibleMethodSignatureKey; @param NO if the buffer copies necessary for invocation failed, YES otherwise. @see invokeWithInvocation:returnValue: */ -- (BOOL)invokeWithInvocation:(NSInvocation *)inv returnValue:(out NSValue **)returnValue; +- (BOOL)invokeWithInvocation:(NSInvocation *)inv returnValue:(out NSValue *__nullable *__nonnull)returnValue; /** Calls the receiver's block with the arguments from the given invocation and sets the return value on the given invocation. @@ -97,3 +99,5 @@ extern NSString *const A2IncompatibleMethodSignatureKey; - (void)invokeWithInvocation:(NSInvocation *)inv; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/DynamicDelegate/A2DynamicDelegate.h b/BlocksKit/DynamicDelegate/A2DynamicDelegate.h index 0243e8f37..d84537534 100644 --- a/BlocksKit/DynamicDelegate/A2DynamicDelegate.h +++ b/BlocksKit/DynamicDelegate/A2DynamicDelegate.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** A2DynamicDelegate implements a class's delegate, data source, or other delegated protocol by associating protocol methods with a block implementation. @@ -67,7 +69,7 @@ /** When replacing the delegate using the A2BlockDelegate extensions, the object responding to classical delegate method implementations. */ -@property (nonatomic, weak, readonly) id realDelegate; +@property (nonatomic, weak, readonly, nullable) id realDelegate; /** @name Block Instance Method Implementations */ @@ -77,7 +79,7 @@ @param selector An encoded selector. Must not be NULL. @return A code block, or nil if no block is assigned. */ -- (id)blockImplementationForMethod:(SEL)selector; +- (nullable id)blockImplementationForMethod:(SEL)selector; /** Assigns the given block to be fired when the specified selector is called on the reciever. @@ -95,7 +97,7 @@ @param selector An encoded selector. Must not be NULL. @param block A code block with the same signature as selector. */ -- (void)implementMethod:(SEL)selector withBlock:(id)block; +- (void)implementMethod:(SEL)selector withBlock:(nullable id)block; /** Disassociates any block so that nothing will be fired when the specified selector is called on the reciever. @@ -125,7 +127,7 @@ @param selector An encoded selector. Must not be NULL. @param block A code block with the same signature as selector. */ -- (void)implementClassMethod:(SEL)selector withBlock:(id)block; +- (void)implementClassMethod:(SEL)selector withBlock:(nullable id)block; /** Disassociates any blocks so that nothing will be fired when the specified selector is called on the delegating @@ -136,3 +138,5 @@ - (void)removeBlockImplementationForClassMethod:(SEL)selector; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/DynamicDelegate/Foundation/NSCache+BlocksKit.h b/BlocksKit/DynamicDelegate/Foundation/NSCache+BlocksKit.h index ed2ce16a7..fa4f142f0 100644 --- a/BlocksKit/DynamicDelegate/Foundation/NSCache+BlocksKit.h +++ b/BlocksKit/DynamicDelegate/Foundation/NSCache+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** NSCache with block adding of objects This category allows you to conditionally add objects to @@ -49,6 +51,8 @@ This block callback is an analog for the cache:willEviceObject: method of NSCacheDelegate. */ -@property (nonatomic, copy, setter = bk_setWillEvictBlock:) void (^bk_willEvictBlock)(NSCache *cache, id obj); +@property (nonatomic, copy, setter = bk_setWillEvictBlock:, nullable) void (^bk_willEvictBlock)(NSCache *cache, id obj); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/DynamicDelegate/NSObject+A2BlockDelegate.h b/BlocksKit/DynamicDelegate/NSObject+A2BlockDelegate.h index 28bef0cc7..bdfb2a486 100644 --- a/BlocksKit/DynamicDelegate/NSObject+A2BlockDelegate.h +++ b/BlocksKit/DynamicDelegate/NSObject+A2BlockDelegate.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** The A2BlockDelegate category extends features provided by A2DynamicDelegate to create custom block properties in a category on a delegating object and dynamically map them to delegate (`UIAlertViewDelegate`), data source @@ -115,3 +117,5 @@ - (id)bk_ensuredDynamicDelegateForProtocol:(Protocol *)protocol; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/DynamicDelegate/NSObject+A2DynamicDelegate.h b/BlocksKit/DynamicDelegate/NSObject+A2DynamicDelegate.h index b508392ad..b09c33913 100644 --- a/BlocksKit/DynamicDelegate/NSObject+A2DynamicDelegate.h +++ b/BlocksKit/DynamicDelegate/NSObject+A2DynamicDelegate.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** The A2DynamicDelegate category to NSObject provides the primary interface by which dynamic delegates are generated for a given object. */ @interface NSObject (A2DynamicDelegate) @@ -65,3 +67,5 @@ - (id)bk_dynamicDelegateForProtocol:(Protocol *)protocol; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/MessageUI/MFMailComposeViewController+BlocksKit.h b/BlocksKit/MessageUI/MFMailComposeViewController+BlocksKit.h index e0452a5ec..8ddc5aae4 100644 --- a/BlocksKit/MessageUI/MFMailComposeViewController+BlocksKit.h +++ b/BlocksKit/MessageUI/MFMailComposeViewController+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** MFMailComposeViewController with block callbacks. If you provide a completion handler to an instance of @@ -26,6 +28,8 @@ mailComposeController:didFinishWithResult:error:method of MFMailComposeViewControllerDelegate. */ -@property (nonatomic, copy, setter = bk_setCompletionBlock:) void (^bk_completionBlock)(MFMailComposeViewController *controller, MFMailComposeResult result, NSError *error); +@property (nonatomic, copy, setter = bk_setCompletionBlock:, nullable) void (^bk_completionBlock)(MFMailComposeViewController *controller, MFMailComposeResult result, NSError *error); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/MessageUI/MFMessageComposeViewController+BlocksKit.h b/BlocksKit/MessageUI/MFMessageComposeViewController+BlocksKit.h index 8f325f638..794a80ef2 100644 --- a/BlocksKit/MessageUI/MFMessageComposeViewController+BlocksKit.h +++ b/BlocksKit/MessageUI/MFMessageComposeViewController+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** MFMessageComposeViewController with block callback in addition to delegation. If you provide a completion handler to an instance of @@ -26,6 +28,8 @@ messageComposeViewController:didFinishWithResult: method of MFMessageComposeViewControllerDelegate. */ -@property (nonatomic, copy, setter = bk_setCompletionBlock:) void (^bk_completionBlock)(MFMessageComposeViewController *controller, MessageComposeResult result); +@property (nonatomic, copy, setter = bk_setCompletionBlock:, nullable) void (^bk_completionBlock)(MFMessageComposeViewController *controller, MessageComposeResult result); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/QuickLook/QLPreviewController+BlocksKit.h b/BlocksKit/QuickLook/QLPreviewController+BlocksKit.h index 8693d3874..158eae593 100644 --- a/BlocksKit/QuickLook/QLPreviewController+BlocksKit.h +++ b/BlocksKit/QuickLook/QLPreviewController+BlocksKit.h @@ -6,18 +6,22 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + @interface QLPreviewController (BlocksKit) -@property (nonatomic, copy, setter = bk_setFrameForPreviewItemInSourceView:) CGRect (^bk_frameForPreviewItem)(QLPreviewController *controller, iditem, UIView **sourceView); +@property (nonatomic, copy, setter = bk_setFrameForPreviewItemInSourceView:, nullable) CGRect (^bk_frameForPreviewItem)(QLPreviewController *controller, iditem, UIView **sourceView); -@property (nonatomic, copy, setter = bk_setTransitionImageForPreviewItem:) UIImage *(^bk_transitionImageForPreviewItem)(QLPreviewController *controller, id item, CGRect *contentRect); +@property (nonatomic, copy, setter = bk_setTransitionImageForPreviewItem:, nullable) UIImage *(^bk_transitionImageForPreviewItem)(QLPreviewController *controller, id item, CGRect *contentRect); -@property (nonatomic, copy, setter = bk_setShouldOpenURLForPreviewItem:) BOOL (^bk_shouldOpenURLForPreviewItem)(QLPreviewController *controller, NSURL *url, id item); +@property (nonatomic, copy, setter = bk_setShouldOpenURLForPreviewItem:, nullable) BOOL (^bk_shouldOpenURLForPreviewItem)(QLPreviewController *controller, NSURL *url, id item); /** The block to be fired before the Quick Look controller will dismiss. */ -@property (nonatomic, copy, setter = bk_setWillDismissBlock:) void (^bk_willDismissBlock)(QLPreviewController *controller); +@property (nonatomic, copy, setter = bk_setWillDismissBlock:, nullable) void (^bk_willDismissBlock)(QLPreviewController *controller); /** The block to be fired after the Quick Look controller did dismiss. */ -@property (nonatomic, copy, setter = bk_setDidDismissBlock:) void (^bk_didDismissBlock)(QLPreviewController *controller); +@property (nonatomic, copy, setter = bk_setDidDismissBlock:, nullable) void (^bk_didDismissBlock)(QLPreviewController *controller); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIBarButtonItem+BlocksKit.h b/BlocksKit/UIKit/UIBarButtonItem+BlocksKit.h index 023d3c25c..6417644fe 100644 --- a/BlocksKit/UIKit/UIBarButtonItem+BlocksKit.h +++ b/BlocksKit/UIKit/UIBarButtonItem+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block event initialization for UIBarButtonItem. This set of extensions has near-drop-in replacements @@ -60,3 +62,5 @@ - (instancetype)bk_initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style handler:(void (^)(id sender))action NS_REPLACES_RECEIVER; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIControl+BlocksKit.h b/BlocksKit/UIKit/UIControl+BlocksKit.h index f452c1592..05e3c1985 100644 --- a/BlocksKit/UIKit/UIControl+BlocksKit.h +++ b/BlocksKit/UIKit/UIControl+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block control event handling for UIControl. Includes code by the following: @@ -48,3 +50,5 @@ - (BOOL)bk_hasEventHandlersForControlEvents:(UIControlEvents)controlEvents; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIGestureRecognizer+BlocksKit.h b/BlocksKit/UIKit/UIGestureRecognizer+BlocksKit.h index f83f040c8..c0d31569f 100644 --- a/BlocksKit/UIKit/UIGestureRecognizer+BlocksKit.h +++ b/BlocksKit/UIKit/UIGestureRecognizer+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block functionality for UIGestureRecognizer. Use of the delay property is pretty straightforward, although @@ -86,7 +88,7 @@ /** Allows the block that will be fired by the gesture recognizer to be modified after the fact. */ -@property (nonatomic, copy, setter = bk_setHandler:) void (^bk_handler)(UIGestureRecognizer *sender, UIGestureRecognizerState state, CGPoint location); +@property (nonatomic, copy, setter = bk_setHandler:, nullable) void (^bk_handler)(UIGestureRecognizer *sender, UIGestureRecognizerState state, CGPoint location); /** Allows the length of the delay after which the gesture recognizer will be fired to modify. */ @@ -103,3 +105,5 @@ - (void)bk_cancel; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIImage+BlocksKit.h b/BlocksKit/UIKit/UIImage+BlocksKit.h index 14ca4e22e..eda81f11d 100644 --- a/BlocksKit/UIKit/UIImage+BlocksKit.h +++ b/BlocksKit/UIKit/UIImage+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Camera Roll export without selectors. Includes code by the following: @@ -20,3 +22,5 @@ UIKIT_EXTERN void BKImageWriteToSavedPhotosAlbum(UIImage *image, void(^completio // Adds a video to the saved photos album. UIKIT_EXTERN void BKSaveVideoAtURLToSavedPhotosAlbum(NSURL *videoURL, void(^completionBlock)(NSError *)); + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIImagePickerController+BlocksKit.h b/BlocksKit/UIKit/UIImagePickerController+BlocksKit.h index 170ce2574..853945787 100644 --- a/BlocksKit/UIKit/UIImagePickerController+BlocksKit.h +++ b/BlocksKit/UIKit/UIImagePickerController+BlocksKit.h @@ -8,6 +8,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** UIImagePickerController with block callback. Created by [Yas Kuraishi](https://github.com/YasKuraishi) and contributed to @@ -21,11 +23,13 @@ /** * The block that fires after the receiver finished picking up an image */ -@property (nonatomic, copy) void(^bk_didFinishPickingMediaBlock)(UIImagePickerController *, NSDictionary *); +@property (nonatomic, copy, nullable) void(^bk_didFinishPickingMediaBlock)(UIImagePickerController *, NSDictionary *); /** * The block that fires after the user cancels out of picker */ -@property (nonatomic, copy) void(^bk_didCancelBlock)(UIImagePickerController *); +@property (nonatomic, copy, nullable) void(^bk_didCancelBlock)(UIImagePickerController *); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIPopoverController+BlocksKit.h b/BlocksKit/UIKit/UIPopoverController+BlocksKit.h index 704fbfe18..838a52509 100644 --- a/BlocksKit/UIKit/UIPopoverController+BlocksKit.h +++ b/BlocksKit/UIKit/UIPopoverController+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block functionality for UIPopoverController. Created by [Alexsander Akers](https://github.com/a2) and contributed to BlocksKit. @@ -15,9 +17,11 @@ @interface UIPopoverController (BlocksKit) /** The block to be called when the popover controller will dismiss the popover. Return NO to prevent the dismissal of the view. */ -@property (nonatomic, copy, setter = bk_setShouldDismissBlock:) BOOL (^bk_shouldDismissBlock)(UIPopoverController *popoverController); +@property (nonatomic, copy, setter = bk_setShouldDismissBlock:, nullable) BOOL (^bk_shouldDismissBlock)(UIPopoverController *popoverController); /** The block to be called when the user has taken action to dismiss the popover. This is not called when -dismissPopoverAnimated: is called directly. */ -@property (nonatomic, copy, setter = bk_setDidDismissBlock:) void (^bk_didDismissBlock)(UIPopoverController *popoverController); +@property (nonatomic, copy, setter = bk_setDidDismissBlock:, nullable) void (^bk_didDismissBlock)(UIPopoverController *popoverController); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UITextField+BlocksKit.h b/BlocksKit/UIKit/UITextField+BlocksKit.h index 5a4d93bb2..b5d0cb131 100644 --- a/BlocksKit/UIKit/UITextField+BlocksKit.h +++ b/BlocksKit/UIKit/UITextField+BlocksKit.h @@ -8,6 +8,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block callbacks for UITextField. @warning UITextField is only available on a platform with UIKit. @@ -22,44 +24,46 @@ * * The return value indicates whether the receiver should begin editing */ -@property (nonatomic, copy) BOOL(^bk_shouldBeginEditingBlock)(UITextField *textField); +@property (nonatomic, copy, nullable) BOOL(^bk_shouldBeginEditingBlock)(UITextField *textField); /** * The block that fires after the receiver begins editing */ -@property (nonatomic, copy) void(^bk_didBeginEditingBlock)(UITextField *textField); +@property (nonatomic, copy, nullable) void(^bk_didBeginEditingBlock)(UITextField *textField); /** * The block that fires before the receiver ends editing * * The return value indicates whether the receiver should end editing */ -@property (nonatomic, copy) BOOL(^bk_shouldEndEditingBlock)(UITextField *textField); +@property (nonatomic, copy, nullable) BOOL(^bk_shouldEndEditingBlock)(UITextField *textField); /** * The block that fires after the receiver ends editing */ -@property (nonatomic, copy) void(^bk_didEndEditingBlock)(UITextField *textField); +@property (nonatomic, copy, nullable) void(^bk_didEndEditingBlock)(UITextField *textField); /** * The block that fires when the receiver's text will change * * The return value indicates whether the receiver should replace the characters in the given range with the replacement string */ -@property (nonatomic, copy) BOOL(^bk_shouldChangeCharactersInRangeWithReplacementStringBlock)(UITextField *textField, NSRange range, NSString *string); +@property (nonatomic, copy, nullable) BOOL(^bk_shouldChangeCharactersInRangeWithReplacementStringBlock)(UITextField *textField, NSRange range, NSString *string); /** * The block that fires when the receiver's clear button is pressed * * The return value indicates whether the receiver should clear its contents */ -@property (nonatomic, copy) BOOL(^bk_shouldClearBlock)(UITextField *textField); +@property (nonatomic, copy, nullable) BOOL(^bk_shouldClearBlock)(UITextField *textField); /** * The block that fires when the keyboard's return button is pressed and the receiver is the first responder * * The return value indicates whether the receiver should return */ -@property (nonatomic, copy) BOOL(^bk_shouldReturnBlock)(UITextField *textField); +@property (nonatomic, copy, nullable) BOOL(^bk_shouldReturnBlock)(UITextField *textField); @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIView+BlocksKit.h b/BlocksKit/UIKit/UIView+BlocksKit.h index 994ba5060..e9f04ca45 100644 --- a/BlocksKit/UIKit/UIView+BlocksKit.h +++ b/BlocksKit/UIKit/UIView+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Convenience on-touch methods for UIView. Includes code by the following: @@ -68,3 +70,5 @@ - (void)bk_eachSubview:(void (^)(UIView *subview))block; @end + +NS_ASSUME_NONNULL_END diff --git a/BlocksKit/UIKit/UIWebView+BlocksKit.h b/BlocksKit/UIKit/UIWebView+BlocksKit.h index 509bcfa16..779997fb9 100644 --- a/BlocksKit/UIKit/UIWebView+BlocksKit.h +++ b/BlocksKit/UIKit/UIWebView+BlocksKit.h @@ -6,6 +6,8 @@ #import "BKDefines.h" #import +NS_ASSUME_NONNULL_BEGIN + /** Block callbacks for UIWebView. @warning UIWebView is only available on a platform with UIKit. @@ -18,15 +20,17 @@ @warning If the delegate implements webView:shouldStartLoadWithRequest:navigationType:, the return values of both the delegate method and the block will be considered. */ -@property (nonatomic, copy, setter = bk_setShouldStartLoadBlock:) BOOL (^bk_shouldStartLoadBlock)(UIWebView *webView, NSURLRequest *request, UIWebViewNavigationType navigationType); +@property (nonatomic, copy, setter = bk_setShouldStartLoadBlock:, nullable) BOOL (^bk_shouldStartLoadBlock)(UIWebView *webView, NSURLRequest *request, UIWebViewNavigationType navigationType); /** The block that is fired when the web view starts loading. */ -@property (nonatomic, copy, setter = bk_setDidStartLoadBlock:) void (^bk_didStartLoadBlock)(UIWebView *webView); +@property (nonatomic, copy, setter = bk_setDidStartLoadBlock:, nullable) void (^bk_didStartLoadBlock)(UIWebView *webView); /** The block that is fired when the web view finishes loading. */ -@property (nonatomic, copy, setter = bk_setDidFinishLoadBlock:) void (^bk_didFinishLoadBlock)(UIWebView *webView); +@property (nonatomic, copy, setter = bk_setDidFinishLoadBlock:, nullable) void (^bk_didFinishLoadBlock)(UIWebView *webView); /** The block that is fired when the web view stops loading due to an error. */ -@property (nonatomic, copy, setter = bk_setDidFinishWithErrorBlock:) void (^bk_didFinishWithErrorBlock)(UIWebView *webView, NSError *error); +@property (nonatomic, copy, setter = bk_setDidFinishWithErrorBlock:, nullable) void (^bk_didFinishWithErrorBlock)(UIWebView *webView, NSError *error); @end + +NS_ASSUME_NONNULL_END \ No newline at end of file