I know that there are several ways of delaying an action in Objective-C like:
performSelector:withObject:afterDelay:
or using NSTimer
.
But there is such a fancy thing called blocks where you can do something like this:
[UIView animateWithDuration:1.50 delay:0 options:(UIViewAnimationOptionCurveEaseOut|UIViewAnimationOptionBeginFromCurrentState) animations:^{
}completion:^(BOOL finished){
}];
Unfortunately, this method applies only to animating things.
How can I create a delay with a block in one method so I don't have to use all those @selectors
and without the need to create a new separate method? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…