2 // NSMutableArray+MoveObject.h
5 // Created by Joe Wreschnig on 3/7/13.
9 #import <Foundation/Foundation.h>
11 @interface
NSMutableArray (MoveObject
)
13 - (void)moveObjectAtIndex
:(NSUInteger
)src toIndex
:(NSUInteger
)dst
;
14 // Move the object at index src to (post-move) index dst. Other
15 // objects shift up or down as necessary to make room, as in
16 // insertObject:atIndex:.
18 - (BOOL
)moveFirstwards
:(id
)object upTo
:(NSUInteger
)minIndex
;
19 - (BOOL
)moveLastwards
:(id
)object upTo
:(NSUInteger
)maxIndex
;
20 // Move an object one step towards the first or last position in
21 // the array, up to a minimum or maximum index. Returns YES if the
22 // array changed; NO if the object was not in the array or was
23 // already at the minimum/maximum index.
25 - (BOOL
)moveFirstwards
:(id
)object
;
26 - (BOOL
)moveLastwards
:(id
)object
;
27 // Move an object towards the first or last position in the array.
28 // Returns YES if the array changed; NO if the object was not in
29 // the array or if the object was already in the first/last