Giter VIP home page Giter VIP logo

dwanimatedlabel's Introduction

DWAnimatedLabel

An UILabel subclass that lets you animate text with different types, inspired by RQShineLabel.

wave

中文教程

Features

  • Subclass of UILabel, easy to use
  • Use CADisplayLinkto perform smooth animation
  • Four different animation
  • Pure swift

typewritter

shine

fade

Installation

You want to add pod 'DWAnimatedLabel', '~> 1.1' similar to the following to your Podfile:

target 'MyApp' do
  pod 'DWAnimatedLabel', '~> 1.1'
end

Then run a pod install inside your terminal, or from CocoaPods.app.

Alternatively to give it a test run, run the command:

pod try DWAnimatedLabel

Usage

You need to import the module fire:

import DWAnimatedLabel

Then you can create the label just like using UILabel.

let label = DWAnimatedLabel(frame: CGRect(x: 20, y: 44, width: UIScreen.main.bounds.size.width, height: 100))
label.text = "LOADING"
label.font = UIFont.systemFont(ofSize: 70, weight: .bold)

Also you can choose animation type by setting the animationType property.

label.animationType = .wave

If you are using wave animation, you also need to set the placeHolderColor property, otherwise it will be UIColor.lightGray.

label.placeHolderColor = .blue

After setting up these properties you can use startAnimation(duration: TimeInterval, _ completion:(() -> Void)?) to start perform animation.

Requirements

  • iOS 9.0 +
  • Swift 4
  • Xcode 9

Contribution

You are welcome to fork and submit pull requests or issues.

License

DWAnimatedLabel is open-sourced software lincened under the MIT license.

Credits

DWAnimatedLabel is owned and maintained by Dywanedu

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.