FadeInText

1.1.1

A SwiftUI based fade-in text animation that works for iOS 15 and above
juyan/swiftui-fadein-text

What's New

v1.1.1

2025-01-21T02:12:52Z

Fix a tokenizer bug.

swiftui-fadein-text

Apache 2.0 License Package Releases Build Results Swift Version Supported Platforms

What

A SwiftUI based fade-in text animation that works for iOS 15 and above.

Why

It's surprisingly difficult/clumsy to build smooth fade-in text animation in SwiftUI prior to iOS 18 TextRenderer APIs.

How

This approach uses AttributedString to achieve a smooth opacity transition over the given time.

It is also designed to be highly customizable so that you can introduce your own logic on how to tokenize the string or interpolate the animation.

Quick Start

import FadeInText

struct MyView: View {
  let text: String
  var body: some View {
    FadeInText(text: text, color: .black, tokenizer: DefaultTokenizer(), interpolator: LinearInterpolator(config: .defaultValue))
  }
}

Animation Preview:

fade-in-text-demo.mov

Description

  • Swift Tools 5.10.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu May 15 2025 11:56:00 GMT-0900 (Hawaii-Aleutian Daylight Time)