Skip to content

cl7/CLTypingLabel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLTypingLabel

Build Status Language GitHub license

iOS/OSX UILabel with character by character typewriter like animation

iOS/OSX上自带逐字打印动画效果的UILabel

##Installation

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

Usage

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

2. Programmatically set a new String to its text property at runtime, animation would be triggered automatically;

Sample Code

@IBOutlet weak var myTypeWriterLabel: CLTypingLabel!

At runtime:

myTypeWriterLabel.text = "This is a demo of typing label animation..."

Additionally, you can pause the typing animation at any time:

myTypeWriterLabel.pauseTyping() //this will pause the typing animation
myTypeWriterLabel.continueTyping() //this will continue paused typing animation

And customize time interval between each character:

myTypeWriterLabel.charInterval = 0.08 //optional, default is 0.1

License

This code is distributed under the terms and conditions of the MIT license.