Last active
March 23, 2020 06:26
-
-
Save madcato/c0e570d7dc80d458927dc7272c073f24 to your computer and use it in GitHub Desktop.
UIImage that continuously blink. "Assign it in the storyboard"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class BlinkingImage: UIImageView { | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
UIView.animate(withDuration: 1.2, | |
delay: 0.0, | |
options: [.autoreverse, .repeat, .curveEaseInOut], | |
animations: { | |
self.alpha = 0.10 | |
}, completion: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment