Github url

LTMorphingLabel

by lexrus

[EXPERIMENTAL] Graceful morphing effects for UILabel written in Swift.

7.3K Stars 759 Forks Last release: almost 3 years ago (0.5.3) MIT License 196 Commits 28 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

LTMorphingLabel

Travis LanguageCocoaPodsCarthage compatibleAccio supported License

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.

Sponsership

GitAds

enum LTMorphingEffect: 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

LTMorphingLabelSwiftUI

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. Xcode 10.3+
  2. iOS 8.0+

Installation

Carthage

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

Accio

  1. Add the following to your Package.swift:
.package(url: "https://github.com/lexrus/LTMorphingLabel.git", .upToNextMajor(from: "0.7.0")),
  1. Next, add
    LTMorphingLabel
    to your App targets dependencies like so:
.target( name: "App", dependencies: ["LTMorphingLabel",] ),
  1. Then run
    accio update
    .

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.

Unit tests

Open the project with Xcode then press command + u.

Alternative

Even though this lib was used ina 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 isZCAnimatedLabel. I’d like to recommend it for production use.

And finally, an Android port.

Third Party Bindings

React Native

You may now use this library with React Native via the module here

License

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.