Last active
April 4, 2017 10:24
-
-
Save phynet/122f522e305ac43e31b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
NSDate *animationStart = [NSDate date]; | |
NSTimeInterval pendingTime = MAX(2 - [[NSDate date] timeIntervalSinceDate:animationStart], 0); | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(pendingTime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
//call a method .... do something | |
}); | |
//DISPATCH_TIME_NOW is a constant declared in dispatch class from iOS 9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment