<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Dictionary/init(minimumCapacity:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SD15minimumCapacitySDyxq_GSi_tcfc"
  },
  "title" : "init(minimumCapacity:)"
}
-->

# init(minimumCapacity:)

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

```
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

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)