---
title: removingLastIndex()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsindexpath/removinglastindex()
---

# removingLastIndex()

Returns an index path with the nodes in the receiving index path, excluding the last one.

## Declaration

```swift
func removingLastIndex() -> IndexPath
```

## Return Value

Return Value A new index path with the receiving index path’s indexes, excluding the last one.

## Discussion

Discussion Returns an empty NSIndexPath instance if the receiving index path’s length is 1 or less. Special Considerations In OS X v10.4 this method returns nil when the length of the receiving index path is 1 or less. On iOS and macOS 10.5 and later this method never returns nil.

## See Also

### Adding and Removing Nodes

- [adding(_:)](foundation/nsindexpath/adding(_:).md)
