Latest 0.1.2
Homepage https://github.com/aivantg/AGTypewriterLabel
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

AGTypewriterLabel Language

AGTypewriterLabel is a UI Label that can animate the display of it’s text character by character. How fast it goes and when it pauses is completely up to you! It’s perfect for use in games, instructional manuals, and anywhere else you can see fit!

Installation

Manual

  1. Copy and paste AGTypewriterLabel.swift to your xcode project.

CocoaPods

  1. Install the latest release of CocoaPods: gem install cocoapods
  2. Add this line to your Podfile: pod 'AGTypewriterLabel'
  3. Install the pod: pod install

Usage

  1. Change the class of a label from UILabel to AGTypewriterLabel;

  2. Use the AGTypewriterLabel.addAnimation() function to add animations to the label

  3. Call AGTypewriterLabel.startAnimation() to start the animation!

  4. Optional: Implement AGTypewriterLabelDelegate and set your label’s delegate to know when the label is done animating

Sample Code


class StoryViewController: UIViewController, AGTypewriterLabelDelegate {

    @IBOutlet weak var typingLabel: AGTypewriterLabel!

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)

        typingLabel.delegate = self

        typingLabel.addAnimation(.text(string: "Hello...", interval: 0.2))
        typingLabel.addAnimation(.pause(length: 1.0))
        typingLabel.addAnimation(.text(string: "World", interval: 0.1))
        typingLabel.addAnimation(.pause(length: 1.0))
        typingLabel.addAnimation(.text(string: "?", interval: 0))

        typingLabel.startAnimation()
    }

    func didFinishAnimating(label: AGTypewriterLabel) {
        // Do Something
    }
}

Latest podspec

{
    "name": "AGTypewriterLabel",
    "version": "0.1.2",
    "summary": "A lightweight UILabel subclass that displays text character-by-character based on customizable animations.",
    "description": "AGTypewriterLabel is a UI Label that can animate the display of it's text character by character. How fast it goes and when it pauses is completely up to you! It's perfect for use in games, instructional manuals, and anywhere else you can see fit!",
    "homepage": "https://github.com/aivantg/AGTypewriterLabel",
    "screenshots": "https://raw.githubusercontent.com/aivantg/AGTypewriterLabel/master/Assets/demo.gif",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "aivantgoyal": "[email protected]"
    },
    "source": {
        "git": "https://github.com/aivantg/AGTypewriterLabel.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AGTypewriterLabel/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This