---
title: "startTextAnimation(_:for:in:writingDirection:)"
framework: uikit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, visionOS 27.0+]
path: "uikit/uiwritingtoolscoordinator/starttextanimation(_:for:in:writingdirection:)"
---

# startTextAnimation(_:for:in:writingDirection:)

Used to support the presentation of grammar issues in text. When an issue is first identified and indicated, call this to have it animated.

## Declaration

```swift
func startTextAnimation(_ textAnimation: UIWritingToolsCoordinator.TextAnimation, for range: NSRange, in context: UIWritingToolsCoordinator.Context, writingDirection: NSWritingDirection) -> UUID?
```

## Discussion

Discussion The context should be large enough to contain the range being indicated, and the range should be the range of the issue within the context. Returns a UUID that can be used to cancel the animation, or nil if the animation cannot be performed. Calls delegate methods to prepare for the animation (which should hide the text), request previews (with and without underlines), and finish the animation (which should show the text).
