---
title: "init(dictionaryLiteral:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsdictionary/init(dictionaryliteral:)"
---

# init(dictionaryLiteral:)

Initializes a newly allocated dictionary from the given key-value pairs.

## Declaration

```swift
required convenience init(dictionaryLiteral elements: (Any, Any)...)
```

## Parameters

- `elements`: A variadic array of two-member tuples, where the first member is a key and the second is its corresponding value.

## See Also

### Creating a Dictionary from Another Dictionary

- [init(dictionary:)](foundation/nsdictionary/init(dictionary:)-9fw1u.md)
- [init(dictionary:copyItems:)](foundation/nsdictionary/init(dictionary:copyitems:).md)
