<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIWritingToolsCoordinator/startTextAnimation(_:for:in:writingDirection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIWritingToolsCoordinator(im)startTextAnimation:forRange:inContext:writingDirection:"
  },
  "title" : "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.

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

## 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).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)