Coder Social home page Coder Social logo

alexcyr / cltypinglabel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cl7/cltypinglabel

0.0 1.0 0.0 869 KB

iOS UILabel with character by character typing /typewriter animation

Home Page: https://cocoapods.org/pods/CLTypingLabel

License: MIT License

Ruby 5.57% Swift 35.41% Objective-C 36.17% C 3.62% Makefile 19.23%

cltypinglabel's Introduction

CLTypingLabel Language

A lightweight UILabel subclass with character by character typewriter like animation in Swift, super simple to use

iOS上自带逐字打印动画效果的UILabel

Installation

Manual

  1. Copy and paste CLTypingLabel.swift to your xcode project.
  1. Install the latest release of CocoaPods: gem install cocoapods
  2. Add this line to your Podfile: pod 'CLTypingLabel'
  3. Install the pod: pod install

Usage

  1. Change the class of a label from UILabel to CLTypingLabel;

2. Programmatically set a new String to its text property at runtime, animation would be triggered automatically;

Sample Code

@IBOutlet weak var myTypeWriterLabel: CLTypingLabel!

At runtime, set text of the label will trigger animation automatically:

myTypeWriterLabel.text = "This is a demo of typing label animation..."

Also works on attributedText:

myTypeWriterLabel.attributedText = NSAttributedString(string: "This is an attributed text typing animation...", attributes: attr)

You can pause the typing animation at any time:

myTypeWriterLabel.pauseTyping() //this will pause the typing animation
myTypeWriterLabel.continueTyping() //this will continue paused typing animation

And customize time interval between each character:

myTypeWriterLabel.charInterval = 0.08 //optional, default is 0.1

License

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

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.