GhostTypewriter 0.5.1

GhostTypewriter 0.5.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by William Boles.


Downloads

Total221
Week2
Month10

Installs

Apps23
Apps WeekApps This Week 1
Test Targets2
powered by Segment

GitHub

Stars35
Watchers1
Forks7
Issues1
Contributors2
Pull Requests0

Code

Files1
LOCLines of Code 84


  • By
  • William Boles

A UILabel subclass that adds a type writing animation effect. The interesting thing about this pod is that the characters will not jump around as they are animated onto the screen instead the characters will be animated onto the screen in their final position - this especially important for multiple line text as the jump can be very visually displeasing.

This pod was inspired by the following post here.

Usage

Animated Typing

TypewriterLabel is a subclass of UILabel and where the animation (magic) happens. It works by taking advantage of the attributedText property on the label and changing the properties of the text content to gradually expose the text using an animation similar to what you get on a mechanical type writer.

Starting

import GhostTypewriter

@IBAction func startAnimationButtonPressed(_ sender: Any) {
    self.descriptionLabel.startTypewritingAnimation(completion: nil)
}

Stoping

import GhostTypewriter

@IBAction func startAnimationButtonPressed(_ sender: Any) {
    if animating {
        descriptionLabel.stopTypewritingAnimation()
    } else {
        self.descriptionLabel.startTypewritingAnimation(completion: nil)
    }
}

Canceling

import GhostTypewriter

@IBAction func startAnimationButtonPressed(_ sender: Any) {
    if animating {
        descriptionLabel.cancelTypewritingAnimation()
    } else {
        self.descriptionLabel.startTypewritingAnimation(completion: nil)
    }
}

Chaining animations

import GhostTypewriter

@IBAction func startAnimationButtonPressed(_ sender: Any) {
    titleLabel.cancelTypewritingAnimation()
    descriptionLabel.cancelTypewritingAnimation()

    titleLabel.startGhostTypewriterAnimation {
        self.descriptionLabel.startTypewritingAnimation(completion: nil)
    }
}

Adjusting animation timing

import GhostTypewriter

override func viewDidLoad() {
    super.viewDidLoad()
    titleLabel.typingTimeInterval = 0.3
}

Storyboards

As TypewriterLabel contained in a pod, when using it in your storyboards you will need to use the Module field with the value GhostTypewriter.

Example

GhostTypewriter comes with an example project to provide more details than listed above.

Found an issue?

Please open a new Issue here if you run into a problem specific to CoreDataServices, have a feature request, or want to share a comment. Note that general Core Data questions should be asked on Stack Overflow.

Pull requests are encouraged and greatly appreciated! Please try to maintain consistency with the existing code style. If you’re considering taking on significant changes or additions to the project, please communicate in advance by opening a new Issue. This allows everyone to get onboard with upcoming changes, ensures that changes align with the project’s design philosophy, and avoids duplicated work.