How to Blink a label in iOS swift
Solution:
You can use the below code to blink the Label at a particular time.Use the extension to blink your Label.
You can use the below code to blink the Label at a particular time.Use the extension to blink your Label.
extension UILabel {
func blink() {
self.alpha = 0.0;
UIView.animate(withDuration: 0.8, //Time duration you want,
delay: 0.0,
options: [.curveEaseInOut, .autoreverse, .repeat],
animations: { [weak self] in self?.alpha = 1.0 },
completion: { [weak self] _ in self?.alpha = 0.0 })
}
}
Comments
Post a Comment