Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Swift :: xib image shown on simulator but not on device 
Swift :: Trailing Closure Swift 
Swift :: selenium lfor loops 
Swift :: Alamofire upload multiple image with parameters swift 5 site:stackoverflow.com 
Swift :: Swift Variables names must start with either a letter 
Swift :: swift connect wifi 
Swift :: Swift Labeled Statement with continue 
Swift :: swift computed property 
Swift :: swift writing to ios logs 
Swift :: property observer in swift 
Swift :: remove grey background when selecting cells from uitableview swift after selection 
Swift :: load plist swift 
Swift :: addition of numbers from array swift 
Ruby :: kill rails 
Ruby :: ruby variable in string 
Ruby :: ruby refinement import dynamic methods 
Ruby :: ruby hash transform values 
Ruby :: ruby get file name 
Ruby :: rails difference in minutes between 2 datetime 
Ruby :: ruby each char with index 
Ruby :: rails validate presence 
Ruby :: ruby square root 
Ruby :: rails link to 
Ruby :: call a class method ruby 
Ruby :: rails faker 
Ruby :: rails 10 times do 
Ruby :: will_paginate gem rails 
Ruby :: ruby string to boolean 
Ruby :: ruby array last 
Ruby :: user.destroy all except one rails 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =