NSMutableArray(KSTExtensions)

@interface NSMutableArray<ObjectType> (KSTExtensions)

/**
 If self.count > 0, removes the first object in the receiver; otherwise does nothing.
 */
- (void)KST_removeFirstObject;

/**
 Reverses the objects of the receiver. This is distinct from KST_reversedArray, which returns a new array.
 */
- (void)KST_reverse;

/**
 Adds *object* to the end of the receiver. Simply calls addObject:.
 
 @param object The object to add
 */
- (void)KST_appendObject:(ObjectType)object;
/**
 Adds the objects in *array* to the end of the receiver. Simply calls addObjectsFromArray:.
 
 @param array The objects to add
 */
- (void)KST_appendArray:(NSArray<ObjectType> *)array;
/**
 Adds the *object* to the beginning of the receiver (i.e. index 0).
 
 @param object The object to add
 */
- (void)KST_prependObject:(ObjectType)object;
/**
 Adds the objects in *array* to the beginning of the receiver (i.e. starting at index 0).
 
 @param array The objects to add
 */
- (void)KST_prependArray:(NSArray<ObjectType> *)array;

/**
 Inserts _object_ at index 0 of the receiver.
 
 @param object The object to insert
 */
- (void)KST_push:(ObjectType)object;
/**
 Removes the first object of the receiver and returns it.
 
 @return The first object of the receiver or nil
 */
- (nullable ObjectType)KST_pop;

/**
 Shuffles the receiver. See http://stackoverflow.com/questions/56648/whats-the-best-way-to-shuffle-an-nsmutablearray for implementation reference.
 */
- (void)KST_shuffle;

@end

Undocumented

  • If self.count > 0, removes the first object in the receiver; otherwise does nothing.

    Declaration

    Objective-C

    - (void)KST_removeFirstObject;
  • Reverses the objects of the receiver. This is distinct from KST_reversedArray, which returns a new array.

    Declaration

    Objective-C

    - (void)KST_reverse;
  • Adds object to the end of the receiver. Simply calls addObject:.

    Declaration

    Objective-C

    - (void)KST_appendObject:(nonnull ObjectType)object;

    Parameters

    object

    The object to add

  • Adds the objects in array to the end of the receiver. Simply calls addObjectsFromArray:.

    Declaration

    Objective-C

    - (void)KST_appendArray:(nonnull NSArray<ObjectType> *)array;

    Parameters

    array

    The objects to add

  • Adds the object to the beginning of the receiver (i.e. index 0).

    Declaration

    Objective-C

    - (void)KST_prependObject:(nonnull ObjectType)object;

    Parameters

    object

    The object to add

  • Adds the objects in array to the beginning of the receiver (i.e. starting at index 0).

    Declaration

    Objective-C

    - (void)KST_prependArray:(nonnull NSArray<ObjectType> *)array;

    Parameters

    array

    The objects to add

  • Inserts object at index 0 of the receiver.

    Declaration

    Objective-C

    - (void)KST_push:(nonnull ObjectType)object;

    Parameters

    object

    The object to insert

  • Removes the first object of the receiver and returns it.

    Declaration

    Objective-C

    - (nullable ObjectType)KST_pop;

    Return Value

    The first object of the receiver or nil

  • Shuffles the receiver. See http://stackoverflow.com/questions/56648/whats-the-best-way-to-shuffle-an-nsmutablearray for implementation reference.

    Declaration

    Objective-C

    - (void)KST_shuffle;