Sha256: ffc7bec9069df5e6bd7e2c3bd05af68088ca80a73f82cfa5fbacb35495c7900d

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

//
//  NSArray+ObjectiveSugar.h
//  WidgetPush
//
//  Created by Marin Usalj on 5/7/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//



@interface NSArray (ObjectiveSugar)

@property(readonly) id first;
@property(readonly) id last;

- (void)each:(void (^)(id object))block;
- (void)eachWithIndex:(void (^)(id object, int index))block;
- (BOOL)includes:(id)object;

- (NSArray *)take:(NSUInteger)numberOfElements;
- (NSArray *)takeWhile:(BOOL (^)(id object))block;

- (NSArray *)map:(id (^)(id object))block;
- (NSArray *)select:(BOOL (^)(id object))block;
- (NSArray *)reject:(BOOL (^)(id object))block;
- (NSArray *)flatten;
- (NSString *)join;
- (NSString *)join:(NSString *)separator;

// Alias for Ruby's & operator
- (NSArray *)intersectionWithArray:(NSArray *)array;
// Alias for Ruby's | operator
- (NSArray *)unionWithArray:(NSArray *)array;
// Alias for Ruby's - operator
- (NSArray *)relativeComplement:(NSArray *)array;
// Alias for Ruby's ^ operator. Equivalent of a - b | b - a
- (NSArray *)symmetricDifference:(NSArray *)array;

@end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appjam-0.1.8.11 lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSArray+ObjectiveSugar.h
appjam-0.1.8.10 lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSArray+ObjectiveSugar.h
appjam-0.1.8.9 lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSArray+ObjectiveSugar.h
appjam-0.1.8.8 lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSArray+ObjectiveSugar.h