Skip to content

ghostcrying/ThenMorphingLabel

Repository files navigation

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

LTMorphingLabel-Evaporate

LTMorphingLabel-Fall

LTMorphingLabel-Pixelate

LTMorphingLabel-Sparkle

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

LTMorphingLabel-Burn

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

  1. File > Swift Packages > Add Package Dependency
  2. Copy & paste https://github.com/ghostcrying/ThenMorphingLabel then follow the instruction
  1. Add this line to your Cartfile: github "ghostcrying/ThenMorphingLabel"
  2. Read the official instruction
  1. Install the latest release of CocoaPods: gem install cocoapods
  2. Add this line to your Podfile: pod 'ThenMorphingLabel'
  3. Install the pod: pod install

Usage

  1. Change the class of a label from UILabel to ThenMorphingLabel;
  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.

About

Swift Morphong Label

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors