---
title: "init(location:end:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nstextrange/init(location:end:)"
---

# init(location:end:)

Creates a new text range with the starting and ending locations you specify.

## Declaration

```swift
init?(location: any NSTextLocation, end endLocation: (any NSTextLocation)?)
```

## Parameters

- `location`: The starting location.
- `endLocation`: The ending location.

## See Also

### Creating a text range

- [init(location:)](appkit/nstextrange/init(location:).md)
