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

# formUnion(_:)

Adds the contents of the given range set to this range set.

## Declaration

```swift
mutating func formUnion(_ other: RangeSet<Bound>)
```

## Parameters

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

## Discussion

Discussion note: O(m + n), where m and n are the number of ranges in this and the other range set.
