---
title: "offset(from:to:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinput/offset(from:to:)"
---

# offset(from:to:)

Returns the distance between two positions in the text view’s text.

## Declaration

```swift
func offset(from: UITextPosition, to toPosition: UITextPosition) -> Int
```

## Mentioned in

Integrating custom browser text views with UIKit
