Skip to content

itstheceo/TypewriterCarouselView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypewriterCarouselView Project logo

A SwiftUI library for rendering text with a typewriter effect.

hello-world.mov

Installation

This repository is a Swift package; include it in your Xcode project and target under File > Add package dependencies, then import TypewriterCarouselView where you'll be using it.

Usage

Two views are available for use, TypewriterCarouselView and TypewriterView.

TypewriterCarouselView

A view that cycles through multiple texts, animated with a typewriter effect.

TypewriterCarouselView(
  text: ["Hello", "World!"],
  speed: .milliseconds(50),
  mode: .writeAndDelete(
    onWriteFinishedDelay: .seconds(3),
    onDeleteFinishedDelay: .seconds(1)
  )
)

TypewriterView

A view that animates text with a typewriter effect.

TypewriterView(
  text: "Hello World!",
  speed: .milliseconds(50),
  mode: .writeAndDelete(
    onWriteFinishedDelay: .seconds(3),
    onDeleteFinishedDelay: .seconds(1)
  )
) {
  print("Animation finished!")
}

Todo

  • Add support for other platforms.
  • Reduce minimum supported platform versions, where possible.

As my use case allows for the current support, I do not know when I will get around to doing this. Pull requests welcome.

Questions

If you have any questions or suggestions, you can create an issue or pull request on this GitHub repository.