---
title: "removeAll(keepingCapacity:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/set/removeall(keepingcapacity:)"
---

# removeAll(keepingCapacity:)

Removes all members from the set.

## Declaration

```swift
mutating func removeAll(keepingCapacity keepCapacity: Bool = false)
```

## See Also

### Removing Elements

- [filter(_:)](swift/set/filter(_:).md)
- [remove(_:)](swift/set/remove(_:)-8p2tv.md)
- [remove(_:)](swift/set/remove(_:)-4d3i1.md)
- [removeFirst()](swift/set/removefirst().md)
- [remove(at:)](swift/set/remove(at:).md)
