---
title: "init(capacity:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsmutableorderedset/init(capacity:)"
---

# init(capacity:)

Returns an initialized mutable ordered set with a given initial capacity.

## Declaration

```swift
init(capacity numItems: Int)
```

## Parameters

- `numItems`: The initial capacity of the new ordered set.

## Return Value

Return Value An initialized mutable ordered set with initial capacity to hold numItems members.

## Discussion

Discussion Mutable ordered sets allocate additional memory as needed, so numItems simply establishes the set’s initial capacity. This method is a designated initializer of NSMutableOrderedSet.

## See Also

### Creating a Mutable Ordered Set

- [init()](foundation/nsmutableorderedset/init().md)
