---
title: "init(dictionary:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsdictionary/init(dictionary:)-9fw1u"
---

# init(dictionary:)

Initializes a newly allocated dictionary by placing in it the keys and values contained in another given dictionary.

## Declaration

```swift
convenience init(dictionary otherDictionary: [AnyHashable : Any])
```

## Parameters

- `otherDictionary`: A dictionary containing the keys and values with which to initialize the new dictionary.

## Return Value

Return Value An initialized dictionary—which might be different than the original receiver—containing the keys and values found in otherDictionary.

## See Also

### Creating a Dictionary from Another Dictionary

- [init(dictionary:copyItems:)](foundation/nsdictionary/init(dictionary:copyitems:).md)
- [init(dictionaryLiteral:)](foundation/nsdictionary/init(dictionaryliteral:).md)
