Reputation: 3504
I tried to animate some features of the UIView, anyway, I simplified everything to these code lines in "ViewController.m":
- (void)viewDidLoad {
...
[UIView animateWithDuration: 5.0 animations:^{
NSLog(@"animations");}
completion:^(BOOL finished){NSLog(@"completion");}];
}
Both blocks outputs immediately after loading despite the fact that animation should last five seconds.
Upvotes: 0
Views: 53
Reputation: 480
You can't use block animations in viewDidLoad
because the UIView you want to animate doesn't have superview at the present moment. Move the code to the viewDidAppear
method.
Upvotes: 3