---
title: "reserveCapacity(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/string/unicodescalarview/reservecapacity(_:)"
---

# reserveCapacity(_:)

Reserves enough space in the view’s underlying storage to store the specified number of ASCII characters.

## Declaration

```swift
mutating func reserveCapacity(_ n: Int)
```

## Parameters

- `n`: The minimum number of ASCII character’s worth of storage to allocate.

## Discussion

Discussion Because a Unicode scalar value can require more than a single ASCII character’s worth of storage, additional allocation may be necessary when adding to a Unicode scalar view after a call to reserveCapacity(_:). note: O(n), where n is the capacity being reserved.
