Skip to content

A simple but usefull typewriter view subclass of UITextView.打字机效果。

License

Notifications You must be signed in to change notification settings

pikacode/TypewriterView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email:pikacode@qq.com

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

About

A simple but usefull typewriter view subclass of UITextView.打字机效果。

Resources

License

Stars

Watchers

Forks

Packages

No packages published