Skip to content

Commit 21fb04d

Browse files
author
jueying
committed
字典和集合的泛型参数支持
1 parent 22f0467 commit 21fb04d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

JKCategories/Foundation/NSDictionary/NSDictionary+JKBlock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- (void)jk_eachValue:(void (^)(ObjectType v))block;
1717
- (NSArray *)jk_map:(id (^)(KeyType key, ObjectType value))block;
1818
- (NSDictionary <KeyType, id>*)jk_mapValues:(id (^)(ObjectType value))block;
19-
- (NSDictionary *)jk_pick:(NSArray *)keys;
20-
- (NSDictionary *)jk_omit:(NSArray *)key;
19+
- (NSDictionary <KeyType, ObjectType>*)jk_pick:(NSArray <KeyType>*)keys;
20+
- (NSDictionary <KeyType, ObjectType>*)jk_omit:(NSArray <KeyType>*)key;
2121

2222
@end

JKCategories/Foundation/NSSet/NSSet+JKBlock.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
#import <Foundation/Foundation.h>
1010

11-
@interface NSSet (JKBlock)
12-
- (void)jk_each:(void (^)(id))block;
13-
- (void)jk_eachWithIndex:(void (^)(id, int))block;
14-
- (NSArray *)jk_map:(id (^)(id object))block;
15-
- (NSArray *)jk_select:(BOOL (^)(id object))block;
16-
- (NSArray *)jk_reject:(BOOL (^)(id object))block;
17-
- (NSArray *)jk_sort;
18-
- (id)jk_reduce:(id(^)(id accumulator, id object))block;
19-
- (id)jk_reduce:(id)initial withBlock:(id(^)(id accumulator, id object))block;
11+
@interface NSSet<__covariant ObjectType> (JKBlock)
12+
- (void)jk_each:(void (^)(ObjectType))block;
13+
- (void)jk_eachWithIndex:(void (^)(ObjectType object, int idx))block;
14+
- (NSArray *)jk_map:(id (^)(ObjectType object))block;
15+
- (NSArray <ObjectType>*)jk_select:(BOOL (^)(ObjectType object))block;
16+
- (NSArray <ObjectType>*)jk_reject:(BOOL (^)(ObjectType object))block;
17+
- (NSArray <ObjectType>*)jk_sort;
18+
- (id)jk_reduce:(id(^)(id accumulator, ObjectType object))block;
19+
- (id)jk_reduce:(id)initial withBlock:(id(^)(id accumulator, id ObjectType))block;
2020
@end

0 commit comments

Comments
 (0)