LTMorphingLabel
A morphing UILabel subclass written in Swift.
The .Scale
effect is originally introduced by Apple in WWDC 2014. New morphing effects are available as Swift extensions.
enum LTMorphingEffect: Int, Printable
.Scale - default
.Evaporate
.Fall
.Pixelate
.Sparkle
.Sparkle
is built on top of QuartzCore.CAEmitterLayer. There’s also a SpriteKit powered version here.
.Burn
.Anvil
Requirements
- Xcode 7
- iOS 8.0+
Installation
Carthage
- Add this line to your Cartfile:
github "lexrus/LTMorphingLabel"
- Run
carthage update
to fetch and build theLTMorphingLabel.framework
- Drag
LTMorphingLabel.framework
into your iOS 8 project
CocoaPods
- Install the latest release of CocoaPods:
gem install cocoapods
- Add this line to your Podfile:
pod 'LTMorphingLabel', '~> 0.0.8'
- Install the pod:
pod install
Usage
- Change the class of a label from UILabel to LTMorphingLabel;
- Programatically set a new String to its text property.
Unit tests
Open the project with Xcode then press command + u.
Alternative
Even though this lib was used in a few products on App Store, it’s still an experimental project. Frankly, there’re some nice competitors out there guarantee both compatibility and stability. And the most outstanding one is ZCAnimatedLabel. I’d like to recommend it for production use.
License
This code is distributed under the terms and conditions of the MIT license.