Skip to content

Latest commit

 

History

History
94 lines (55 loc) · 1.21 KB

README.md

File metadata and controls

94 lines (55 loc) · 1.21 KB

Email:[email protected]

TypewriterView

A simple but usefull typewriter view subclass of UITextView.

Screenshot

Installation

use_frameworks!
target 'YourTargetName' do
  pod 'TypewriterView'
end

Usage

Init
let typewriterView = TypewriterView(frame: frame)
Write
/* Write */
typewriterView.write("some content")
typewriterView.write("some content", speed: 0.05)

/* Cursor Blink */
typewriterView.cursorBlink()
typewriterView.cursorBlink("I", speed: 0.02, repeats: 5)

/* Pause/Resume */
typewriterView.pause()
typewriterView.resume()

/* Unod */
typewriterView.undo(15)
typewriterView.undo(20, speed: 0.02)
Clear/Stop
/* Clear */
//clear text, but will not stop writing
typewriterView.clear()

/* Stop */
//stop writing right now, and discard unwrite contents
typewriterView.stop()

/* Discard Unwrite Contents */
//discard unwrite contents, but keeps writing current text
typewriterView.discardUnwriteContents()
Completion Block
/* Completion Block */
typewriterView.completionBlock = {
    doSomeThing()
}
Status
/* Status */
typewriterView.isPausing
typewriterView.isFinished