Swiftpack.co - Package - OkiRules/TypewriterLabel

TypewriterLabel

The easy way to add a typewriter effect to any UILabel. Purley written in Swift!

Swift Swift

Installation

Swift Package Manager

Add .package(url: "https://github.com/OkiRules/TypewriterLabel.git", from: "1.0.0") to your Package.swift file's dependencies.

Usage

TypewirterLabel is very easy to use. Here's how to implement it:

  1. Change you labels class to TypewirterLabel. You can do this in the storyboard through the identity inspector.
  2. Call yourLabelName.startTyping() when you want the text to start animating.
  3. Thats it!

Other Useful Methods

There are also other methods to enhace your label even more, these are:

yourLabelName.pauseTyping() to pause the animation.
yourLabelName.resumeTyping() to resume the animation.
yourLabelName.onTypingAnimationFinished = {} to get a callback when the animation is complete.

Example

You can download the example above or take a look below.

import UIKit
import TypewriterLabel

class ViewController: UIViewController {
    
    @IBOutlet weak var yourLabel: TypewriterLabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        yourLabel.startTyping()
        yourLabel.onTypingAnimationFinished = {
            self.showButton()
        }
    }
    
    func pauseButtonPressed() {
        yourLabel.pauseTyping()
    }
    
    func resumeButtonPressed() {
        yourLabel.resumeTyping()
    }
    
    func showButton() {
        yourButton.isHidden = false
    }
}

License

TypewriterLabel is MIT licensed.

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

1.0.2 - Jun 16, 2019

1.0.1 - Jun 16, 2019

1.0.0 - Jun 16, 2019