SwiftUI module that extends the Text class providing a vintage typewriter effect.
Report Bug
ยท
Request Feature
Welcome to the TypewrittenText SwiftUI module!
In the past, before voice acting was widely used, text in video games would appear on the screen as if it was being typed out. This added a sense of realism to the dialogue, as it mimicked the natural pace of speech by revealing the words gradually.
Nowadays, this technique is still used in some contexts. For instance, ChatGPT from OpenAI uses type-on text to give the impression of spoken conversation when no actual voice is present.
This Swift Package, built entirely with SwiftUI, is a great way to implement the effect on your iOS projects.
To install the Kit using Swift Package Manager, you can follow the steps below:
File
โ Add Packages...
Once you have installed the Swift Package, you will need to import it:
import TypewrittenText
And then use the TypewrittenText
class initializer, whose parameters are:
TypewrittenText(finalText: String, delay: Double)
finalText
โ The text you want to typedelay
โ The amount of seconds the app will take before writing the next letterThe following example shows the code used in the demonstration of the module, where the text is written with a delay of 0.2 seconds:
import SwiftUI
import TypewrittenText
struct ContentView: View {
var body: some View {
TypewrittenText(finalText: "Welcome, thank you for watching this demo.", delay: 0.2)
.font(.title)
.padding()
}
}
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
See the open issues for a full list of proposed features (and known issues). If you have a suggestion that would make this better, please:
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is distributed under the GNU General Public License. See the LICENSE file for more information.
link |
Stars: 1 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics