---
title: "removeLast(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/navigationpath/removelast(_:)"
---

# removeLast(_:)

Removes values from the end of this path.

## Declaration

```swift
mutating func removeLast(_ k: Int = 1)
```

## Parameters

- `k`: The number of values to remove. The default value is 1.

## Discussion

Discussion note: The input parameter k must be greater than or equal to zero, and must be less than or equal to the number of elements in the path.

## See Also

### Managing path contents

- [isEmpty](swiftui/navigationpath/isempty.md)
- [count](swiftui/navigationpath/count.md)
- [append(_:)](swiftui/navigationpath/append(_:).md)
