---
title: "init(set:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsset/init(set:)-1xovx"
---

# init(set:)

Initializes a newly allocated set and adds to it objects from another given set.

## Declaration

```swift
convenience init(set: Set<AnyHashable>)
```

## Parameters

- `set`: A set containing objects to add to the receiving set. Each object is retained as it is added.

## Return Value

Return Value An initialized objects set containing the objects from set. The returned set might be different than the original receiver.

## See Also

### Initializing a Set

- [init(array:)](foundation/nsset/init(array:).md)
- [init(objects:count:)](foundation/nsset/init(objects:count:)-7kift.md)
- [init(set:copyItems:)](foundation/nsset/init(set:copyitems:).md)
- [init()](foundation/nsset/init().md)
