---
title: "isPosition(_:atBoundary:inDirection:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextinputtokenizer/isposition(_:atboundary:indirection:)"
---

# isPosition(_:atBoundary:inDirection:)

Return whether a text position is at a boundary of a text unit of a specified granularity in a specified direction.

## Declaration

```swift
func isPosition(_ position: UITextPosition, atBoundary granularity: UITextGranularity, inDirection direction: UITextDirection) -> Bool
```

## Parameters

- `position`: A text-position object that represents a location in a document.
- `granularity`: A constant that indicates a certain granularity of text unit.
- `direction`: A constant that indicates a direction relative to position. The constant can be of type UITextStorageDirection or UITextLayoutDirection.

## Return Value

Return Value true if the text position is at the given text-unit boundary in the given direction; false if it is not at the boundary.

## See Also

### Determining text positions relative to unit boundaries

- [isPosition(_:withinTextUnit:inDirection:)](uikit/uitextinputtokenizer/isposition(_:withintextunit:indirection:).md)
