SwiftUI: Animate newly inserted characters in TextEditor (scale from 1.2 → 1.0 while typing)

3 weeks ago 19
ARTICLE AD BOX

I want to reproduce this typing effect:
https://youtube.com/shorts/ug0gylFjymQ

When the user types, each newly inserted character briefly appears slightly larger (~1.2 scale) and animates down to 1.0. The animation applies only to the inserted characters, not the entire text view.

Requirements:

Per-character animation (only newly inserted range)

~120–200ms ease-out scale animation (1.2 → 1.0)

Works with fast typing, paste, undo

Keeps native editing behavior (cursor, selection, IME)

Animating the whole TextEditor doesn’t work — I need to animate only the inserted characters.

Questions:

Is this achievable in pure SwiftUI?

If not, is UITextView + TextKit the correct approach?

What’s the recommended way to detect and animate only the newly inserted characters?

Any minimal example or pointers would be appreciated.

Read Entire Article