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

# union(_:)

Returns a new range set containing the contents of both this set and the given set.

## Declaration

```swift
func union(_ other: RangeSet<Bound>) -> RangeSet<Bound>
```

## Parameters

- `other`: The range set to merge with this one.

## Return Value

Return Value A new range set.
