TypeOutAnimationLabel 0.1.0

TypeOutAnimationLabel 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2016
SPMSupports SPM

Maintained by Buu Bui.




  • By
  • Buu Bui

TypeOutAnimationLabel

An UILabel with type out animation, inspired from https://connoratherton.com/typeout

Screenshot

Installation

TypeOutAnimationLabel is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "TypeOutAnimationLabel"

Example Usage

let font = UIFont.systemFontOfSize(20)
let fixedString = NSAttributedString(string: "San Francisco is ", attributes: [NSForegroundColorAttributeName: UIColor(red: 0.38, green: 0.388, blue: 0.404, alpha: 1), NSFontAttributeName: font])
let rString1 = NSAttributedString(string: "amazing", attributes: [ NSForegroundColorAttributeName: UIColor(red: 0.396, green: 0.82, blue: 0.396, alpha: 1), NSFontAttributeName: font ])
let rString2 = NSAttributedString(string: "beautiful", attributes: [ NSForegroundColorAttributeName: UIColor(red: 0.953, green: 0.612, blue: 0.0706, alpha: 1), NSFontAttributeName: UIFont.boldSystemFontOfSize(20) ])
let rString3 = NSAttributedString(string: "different", attributes: [ NSForegroundColorAttributeName: UIColor(red: 0.204, green: 0.596, blue: 0.859, alpha: 1), NSFontAttributeName: UIFont.italicSystemFontOfSize(20) ])
let rString4 = NSAttributedString(string: "an experience.", attributes: [ NSForegroundColorAttributeName: UIColor(red: 0.906, green: 0.298, blue: 0.235, alpha: 1), NSFontAttributeName: font ])

label.animationWithFixedString(fixedString, replaceableStrings: [rString1, rString2, rString3, rString4], typeSpeed: 0.1, delay: 2, completion: nil)

Author

Buu Bui

License

TypeOutAnimationLabel is available under the MIT license. See the LICENSE file for more info.