ThenMorphingLabel 0.0.1

ThenMorphingLabel 0.0.1

Maintained by ghost.



  • By
  • ghost

ThenMorphingLabel

Fork from LTMorphingLabel

A morphing UILabel subclass written in Swift. The .Scale effect mimicked Apple's QuickType animation of iOS 8 of WWDC 2014. New morphing effects are available as Swift extensions.

enum ThenMorphingLabel.Effect: Int, Printable

.Scale - default

LTMorphingLabel

.Evaporate

LTMorphingLabel-Evaporate

.Fall

LTMorphingLabel-Fall

.Pixelate

LTMorphingLabel-Pixelate

.Sparkle

LTMorphingLabel-Sparkle

.Sparkle is built on top of QuartzCore.CAEmitterLayer. There's also a SpriteKit powered version here.

.Burn

LTMorphingLabel-Burn

.Anvil

LTMorphingLabel-Anvil

SwiftUI

public var body: some View {
    VStack {
        MorphingText(
            "Awesome Morphing Text",
            effect: .evaporate,
            font: UIFont.systemFont(ofSize: 20),
            textColor: .black,
            textAlignment: .center
        ).frame(maxWidth: 200, maxHeight: 100)
        ...

Requirements

  1. iOS 11.0+

Installation

Swift Package Manager

  1. File > Swift Packages > Add Package Dependency
  2. Copy & paste https://github.com/ghostcrying/ThenMorphingLabel then follow the instruction

Carthage

  1. Add this line to your Cartfile: github "ghostcrying/ThenMorphingLabel"
  2. Read the official instruction

CocoaPods

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

Usage

  1. Change the class of a label from UILabel to LTMorphingLabel;
  2. Programmatically set a new String to its text property.
  3. To use interactively, call .pause() after changing .text property, and use updateProgress(progress: Float)to update the progress interactively.