Text (by word/letter) animation similar to Apple Keynote

116 Views Asked by At

I have some experience with Swift and I'm creating a small macOS app that should allow to animate specific elements, but especially text.

It should be possible to animate the text word-by-word or letter-by-letter, depending on a setting. No super crazy animations, just "simple" fade or fade-in-slide animations are the plan for now.

The solutions I've found use a HStack with the splitted words/letters. It's okay, but still not good enough in my opinion. Especially the kerning between letters like "W" and "o" isn't accurate (obviously it's missing).

I've noticed that Apple Keynote has similar animations, but I haven't figured it out how it could be made.

I tried to split the text into letters, calculate the lines and offsets and then manually put all together. But that doesn't felt right nor very performant. I used CoreText for that.

Does someone has an idea how they do it or asked differently – how would you create those animations?

0

There are 0 best solutions below