---
title: "sortRange(_:options:usingComparator:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableorderedset/sortrange(_:options:usingcomparator:)"
---

# sortRange(_:options:usingComparator:)

Sorts the specified range of the mutable ordered set using the specified options and the comparison method specified by a given comparator block.

## Declaration

```swift
func sortRange(_ range: NSRange, options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult)
```

## Parameters

- `range`: The range to sort.
- `opts`: A bitmask that specifies the options for the sort (whether it should be performed concurrently and whether it should be performed stably).
- `cmptr`: A comparator block.

## See Also

### Sorting Entries

- [sort(using:)](foundation/nsmutableorderedset/sort(using:).md)
- [sort(comparator:)](foundation/nsmutableorderedset/sort(comparator:).md)
- [sort(options:usingComparator:)](foundation/nsmutableorderedset/sort(options:usingcomparator:).md)
