---
title: "union(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableset/union(_:)"
---

# union(_:)

Adds each object in another given set to the receiving set, if not present.

## Declaration

```swift
func union(_ otherSet: Set<AnyHashable>)
```

## Parameters

- `otherSet`: The set of objects to add to the receiving set.

## See Also

### Related Documentation

- [add(_:)](foundation/nsmutableset/add(_:).md)
- [addObjects(from:)](foundation/nsmutableset/addobjects(from:).md)

### Combining and recombining sets

- [minus(_:)](foundation/nsmutableset/minus(_:).md)
- [intersect(_:)](foundation/nsmutableset/intersect(_:).md)
- [setSet(_:)](foundation/nsmutableset/setset(_:).md)
