pEpObjCAdapter/NSArray+Extension.h
changeset 187 1f630a05e444
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pEpObjCAdapter/NSArray+Extension.h	Wed May 17 09:27:57 2017 +0200
     1.3 @@ -0,0 +1,25 @@
     1.4 +//
     1.5 +//  NSArray+Extension.h
     1.6 +//  pEpiOSAdapter
     1.7 +//
     1.8 +//  Created by Dirk Zimmermann on 03.05.17.
     1.9 +//  Copyright © 2017 p≡p. All rights reserved.
    1.10 +//
    1.11 +
    1.12 +#import <Foundation/Foundation.h>
    1.13 +
    1.14 +@interface ArrayTake : NSObject
    1.15 +
    1.16 +@property (nonatomic, readonly) NSArray * _Nonnull elements;
    1.17 +@property (nonatomic, readonly) NSArray * _Nonnull rest;
    1.18 +
    1.19 +@end
    1.20 +
    1.21 +@interface NSArray (Extension)
    1.22 +
    1.23 +/**
    1.24 + @Return The next count elements or nil, if less than that amount available.
    1.25 + */
    1.26 +- (ArrayTake * _Nullable)takeOrNil:(NSInteger)count;
    1.27 +
    1.28 +@end