Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Blinking effect on UILabel

extension UILabel {

    func startBlink() {
        UIView.animate(withDuration: 0.8,
              delay:0.0,
              options:[.allowUserInteraction, .curveEaseInOut, .autoreverse, .repeat],
              animations: { self.alpha = 0 }, 
              completion: nil)
    }

    func stopBlink() {
        layer.removeAllAnimations()
        alpha = 1
    }
}

//Useage e.g. 
loginButton.blink(duration: 1, delay: 0.1, alpha: 0.0100000003)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Blinking #effect #UILabel
ADD COMMENT
Topic
Name
8+2 =