mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
21 lines
738 B
Objective-C
21 lines
738 B
Objective-C
//
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
@interface NSArray (FunctionalUtil)
|
|
|
|
/// Returns true when any of the items in this array match the given predicate.
|
|
- (bool)any:(int (^)(id item))predicate;
|
|
|
|
/// Returns true when all of the items in this array match the given predicate.
|
|
- (bool)all:(int (^)(id item))predicate;
|
|
|
|
/// Returns an array of all the results of passing items from this array through the given projection function.
|
|
- (NSArray *)map:(id (^)(id item))projection;
|
|
|
|
/// Returns an array of all the results of passing items from this array through the given projection function.
|
|
- (NSArray *)filter:(int (^)(id item))predicate;
|
|
|
|
- (NSDictionary *)groupBy:(id (^)(id value))keySelector;
|
|
|
|
@end
|