iOS App Development Book/Video Series
The Series on How to Create iPhone & iPad Apps
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
SMF - Just Installed!
Home
Help
Search
Login
Register
iOS App Development Book/Video Series
»
General Category
»
FAQs
»
How to execute code after a UIImageView animation completes--without timers!
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to execute code after a UIImageView animation completes--without timers! (Read 5099 times)
kjmcneish
Administrator
Posts: 719
How to execute code after a UIImageView animation completes--without timers!
«
on:
September 15, 2015, 03:51:57 AM »
I found a great little extension to UIImageView that allows you to specify a block to be executed after the UIImageView animation is complete. Unlike other solutions that use a timer (bad idea). It uses CAKeyframeAnimation instead, with its animationDidStop method, which is far more reliable:
https://github.com/gurmundi7/UIImageView-AnimationCompletionBlock
It's written in Objective-C, so you Swifters just need to add it to your project and then import it in your bridging header file:
Code:
[Select]
#import "UIImageView+AnimationCompletion.h"
All the best!
Kevin McNeish
Author of Learn to Code in Swift:
https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
«
Last Edit: September 15, 2015, 03:54:37 AM by kjmcneish
»
Logged
Print
Pages: [
1
]
« previous
next »
iOS App Development Book/Video Series
»
General Category
»
FAQs
»
How to execute code after a UIImageView animation completes--without timers!