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

# symmetricDifference(_:)

Returns a new range set representing the values in this range set or the given range set, but not both.

## Declaration

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

## Parameters

- `other`: The range set to find a symmetric difference with.

## Return Value

Return Value A new range set.
