Skip to content

Commit

Permalink
字典和集合的泛型参数支持
Browse files Browse the repository at this point in the history
  • Loading branch information
jueying committed Jun 8, 2020
1 parent 22f0467 commit 21fb04d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions JKCategories/Foundation/NSDictionary/NSDictionary+JKBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- (void)jk_eachValue:(void (^)(ObjectType v))block;
- (NSArray *)jk_map:(id (^)(KeyType key, ObjectType value))block;
- (NSDictionary <KeyType, id>*)jk_mapValues:(id (^)(ObjectType value))block;
- (NSDictionary *)jk_pick:(NSArray *)keys;
- (NSDictionary *)jk_omit:(NSArray *)key;
- (NSDictionary <KeyType, ObjectType>*)jk_pick:(NSArray <KeyType>*)keys;
- (NSDictionary <KeyType, ObjectType>*)jk_omit:(NSArray <KeyType>*)key;

@end
18 changes: 9 additions & 9 deletions JKCategories/Foundation/NSSet/NSSet+JKBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

#import <Foundation/Foundation.h>

@interface NSSet (JKBlock)
- (void)jk_each:(void (^)(id))block;
- (void)jk_eachWithIndex:(void (^)(id, int))block;
- (NSArray *)jk_map:(id (^)(id object))block;
- (NSArray *)jk_select:(BOOL (^)(id object))block;
- (NSArray *)jk_reject:(BOOL (^)(id object))block;
- (NSArray *)jk_sort;
- (id)jk_reduce:(id(^)(id accumulator, id object))block;
- (id)jk_reduce:(id)initial withBlock:(id(^)(id accumulator, id object))block;
@interface NSSet<__covariant ObjectType> (JKBlock)
- (void)jk_each:(void (^)(ObjectType))block;
- (void)jk_eachWithIndex:(void (^)(ObjectType object, int idx))block;
- (NSArray *)jk_map:(id (^)(ObjectType object))block;
- (NSArray <ObjectType>*)jk_select:(BOOL (^)(ObjectType object))block;
- (NSArray <ObjectType>*)jk_reject:(BOOL (^)(ObjectType object))block;
- (NSArray <ObjectType>*)jk_sort;
- (id)jk_reduce:(id(^)(id accumulator, ObjectType object))block;
- (id)jk_reduce:(id)initial withBlock:(id(^)(id accumulator, id ObjectType))block;
@end

0 comments on commit 21fb04d

Please sign in to comment.