44 lines
1.6 KiB
Objective-C
44 lines
1.6 KiB
Objective-C
//
|
||
// NSIndexPath+MPRemoveFirstIndex.h
|
||
// MathPad
|
||
//
|
||
// Created by Kim Wittenburg on 23.04.14.
|
||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||
//
|
||
|
||
@import Foundation;
|
||
|
||
@interface NSIndexPath (MPAdditions)
|
||
|
||
- (NSUInteger)firstIndex;
|
||
- (NSUInteger)lastIndex;
|
||
|
||
- (NSIndexPath *)indexPathByReplacingLastIndexWithIndex:(NSUInteger)index;
|
||
|
||
/*!
|
||
@method indexPathByRemovingFirstIndex
|
||
@brief Provides an index path with the indexes in the receiving index path, excluding the first one.
|
||
@discussion Returns an empty NSIndexPath instance if the receiving index path’s length is 1 or less.
|
||
@return A new index path with the receiving index path’s indexes, excluding the first one.
|
||
*/
|
||
- (NSIndexPath *)indexPathByRemovingFirstIndex;
|
||
|
||
/*!
|
||
@method indexPathByPreceedingIndex:
|
||
@brief Provides an index path with the given index followed by the indexes of the receiver.
|
||
@discussion If the receiver does not contain any indexes the given index is the only index contained in the returned index path.
|
||
@param index The index new index preceeding all others
|
||
@return A new index path with all the receiver's indexes preceeded by @c index.
|
||
*/
|
||
- (NSIndexPath *)indexPathByPreceedingIndex:(NSUInteger)index;
|
||
|
||
- (NSIndexPath *)indexPathByIncrementingLastIndex;
|
||
- (NSIndexPath *)indexPathByDecrementingLastIndex;
|
||
|
||
- (NSIndexPath *)indexPathByRemovingIndexesFrom:(NSUInteger)length; // use length indexes from the receiver, exception if too much
|
||
- (NSIndexPath *)indexPathByRemovingIndexesTo:(NSUInteger)length; // number of indexes from the beginning to exclude
|
||
|
||
- (NSIndexPath *)commonIndexPathWith:(NSIndexPath *)indexPath;
|
||
|
||
@end
|