---
title: "isEqual(to:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextrange/isequal(to:)"
---

# isEqual(to:)

Compares two text ranges.

## Declaration

```swift
func isEqual(to textRange: NSTextRange) -> Bool
```

## Parameters

- `textRange`: The range used to compare against the current range to evaluate for differences.

## Return Value

Return Value Returns true if the ranges are equal.

## See Also

### Comparing text ranges

- [intersection(_:)](uikit/nstextrange/intersection(_:).md)
- [intersects(_:)](uikit/nstextrange/intersects(_:).md)
- [union(_:)](uikit/nstextrange/union(_:).md)
