iOS:add NS_NOESCAPE attribute to avoid warnning
This commit is contained in:
parent
c712b1c0c0
commit
f44416a139
@ -21,11 +21,11 @@
|
||||
|
||||
|
||||
@interface NSObject (Doric)
|
||||
- (id)apply:(id (^)(id it))block;
|
||||
- (id)apply:(id (NS_NOESCAPE ^)(id it))block;
|
||||
|
||||
- (instancetype)also:(void (^)(id it))block;
|
||||
- (instancetype)also:(void (NS_NOESCAPE ^)(id it))block;
|
||||
|
||||
- (void)let:(void (^)(id it))block;
|
||||
- (void)let:(void (NS_NOESCAPE ^)(id it))block;
|
||||
@end
|
||||
|
||||
@interface NSArray <ObjectType> (Doric)
|
||||
|
@ -20,16 +20,16 @@
|
||||
#import "DoricExtensions.h"
|
||||
|
||||
@implementation NSObject (Doric)
|
||||
- (id)apply:(id (^)(id it))block {
|
||||
- (id)apply:(id (^)(NS_NOESCAPE id it))block {
|
||||
return block(self);
|
||||
}
|
||||
|
||||
- (instancetype)also:(void (^)(id it))block {
|
||||
- (instancetype)also:(void (NS_NOESCAPE ^)(id it))block {
|
||||
block(self);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)let:(void (^)(id it))block {
|
||||
- (void)let:(void (NS_NOESCAPE ^)(id it))block {
|
||||
block(self);
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user