Coder Social home page Coder Social logo

azureplus / ltmorphinglabel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lexrus/ltmorphinglabel

0.0 1.0 0.0 1.52 MB

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

License: MIT License

Swift 95.43% Ruby 2.08% Objective-C 0.59% Shell 1.89%

ltmorphinglabel's Introduction

LTMorphingLabel

Travis Language CocoaPods Carthage compatible Accio 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.

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 12
  2. iOS 9.0+

Installation

Swift Package Manager

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

XCFramework

XCFramework is a new option introduced in Xcode 11. You can manually download the pre-compiled LTMorphingLabel.xcframework.zip from the Releases page. Then drag and drop it into your project.

Carthage

  1. Add this line to your Cartfile: github "lexrus/LTMorphingLabel"
  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

Accio

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

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 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.

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.

ltmorphinglabel's People

Contributors

0xleif avatar afdreher avatar biku avatar dustfire avatar fabi755 avatar jeehut avatar jonicong avatar lexrus avatar mofneko avatar muhammadbassio avatar nobre84 avatar pahmed avatar prscx avatar rivera-ernesto avatar sjrmanning avatar tstanik avatar wh1100717 avatar yonaskolb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.