RimhTypingLetters 0.1.1

RimhTypingLetters 0.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version echo "4.0" > .swift-version
SPMSupports SPM

Maintained by Rimh-(Ming).



  • By
  • Rimh(Ming)

RimhTypingLetters

Version
License
Platform

A simple typing animation for UITextView and UILabel.

Requirements

XCode 9.1, Swift 4.0, iOS 8 or above

Demo

Just simply typing text (no-wrapping).

typing

Typing with word-wrap.

typing_delimiter

Installation

RimhTypingLetters is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'RimhTypingLetters'

Usage

First, you need to import the module.

import RimhTypingLetters

For TextView:

@IBOutlet weak var textview:TypingLetterUITextView!
// You can specific delimiter to wrap the content such as a space.
textview.typeText(message, delimiter: " ", typingSpeedPerChar: 0.05, didResetContent: true) {
            // complete action after finished typing
}
// By default: delimiter = nil (no-wrapping), typingSpeedPerChar = 0.04, didResetContent = true.
textview.typeText(message) {
           // complete action after finished typing
}

For Label:

// Extension function in UILabel is similar to TypingLetterUITextView's function, just only delimiter parameter is not exist. 
label.typeText(message, typingSpeedPerChar: 0.1, didResetContent = true, completeCallback:{
           // complete action after finished typing
}

If you want to customize the function, you can create a subclass.

class MyTextView:TypingLetterUITextView {
    override func updateTypingTextView(_ character: Character) {
        super.updateTypingTextView(character)
    }
}

License

RimhTypingLetters is available under the MIT license. See the LICENSE file for more info.