Sha256: 6aecc49fc06dd4acf8a2ac7d5375d8ae7d5126ea6b9ed029d2c2a0453ce82eb9
Contents?: true
Size: 739 Bytes
Versions: 60
Compression:
Stored size: 739 Bytes
Contents
#import <Foundation/Foundation.h> #import "StrainExample.h" NS_ASSUME_NONNULL_BEGIN @implementation NSArray (StrainExample) -(instancetype)keep:(BOOL)compare where:(BOOL (^)(id))completionHandler{ NSMutableArray *filteredArray = [NSMutableArray array]; for(int index = 0;index < self.count;index++){ id objectInArray = self[index]; BOOL flag = completionHandler(objectInArray); if(flag == compare){ [filteredArray addObject:objectInArray]; } } return filteredArray; } -(instancetype)discard:(BOOL (^)(id))completionHandler{ return [self keep:false where:completionHandler]; } @end NS_ASSUME_NONNULL_END
Version data entries
60 entries across 60 versions & 1 rubygems