TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2017 |
SwiftSwift Version | echo "4.0" > .swift-version |
SPMSupports SPM | ✗ |
Maintained by Rimh-(Ming).
A simple typing animation for UITextView and UILabel.
XCode 9.1, Swift 4.0, iOS 8 or above
Just simply typing text (no-wrapping).
Typing with word-wrap.
RimhTypingLetters is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'RimhTypingLetters'
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)
}
}
RimhTypingLetters is available under the MIT license. See the LICENSE file for more info.