I\'m having trouble making the blocks work on Swift. Here\'s an example that worked (without completion block):
UIView.animateWithDuration(0.07) {
self.so
SWIFT 3.x + 4.x
I'd like to make an update and simplify the things.
Example below is implemented in any view
it is hiding slowly and when it is completely transparent; removes it self from parent view
ok
variable will always returns true
with animation termination.
alpha = 1
UIView.animate(withDuration: 0.5, animations: {
self.alpha = 0
}) { (ok) in
print("Ended \(ok)")
self.removeFromSuperview()
}