In swift, I am transitioning an object in to the view, and I need it to slide in, or fade in. How can I obtain this type of animation in my program?
I have all my view elements made programmatically without IB (Interface Builder)
Is there documentation I can look at for reference? I could not find any.
I'm used to using [UIView animateWithDuration ...], but I found it a bit tricky switching the block syntax over to Swift at first. Here's a quick lazy code:
view.alpha = 0.0
UIView.animateWithDuration(0.25, animations: {
view.alpha = 1.0
}, completion: {
(value: Bool) in
println(">>> Animation done.")
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With