---
title: "init(minimumCapacity:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/dictionary/init(minimumcapacity:)"
---

# init(minimumCapacity:)

Creates an empty dictionary with preallocated space for at least the specified number of elements.

## Declaration

```swift
init(minimumCapacity: Int)
```

## Parameters

- `minimumCapacity`: The minimum number of key-value pairs that the newly created dictionary should be able to store without reallocating its storage buffer.

## Discussion

Discussion Use this initializer to avoid intermediate reallocations of a dictionary’s storage buffer when you know how many key-value pairs you are adding to a dictionary after creation.

## See Also

### Creating a Dictionary

- [init()](swift/dictionary/init().md)
- [init(uniqueKeysWithValues:)](swift/dictionary/init(uniquekeyswithvalues:).md)
- [init(_:uniquingKeysWith:)](swift/dictionary/init(_:uniquingkeyswith:).md)
- [init(grouping:by:)](swift/dictionary/init(grouping:by:).md)
