我想创建递归动画。这是我的代码:
- (void)startAnimation {
[UIView animateWithDuration:5.0
animations:^{
NSLog(@"animation");
}
completion:^(BOOL finished) {
if(!canceled) {
NSLog(@"completed");
[self startAnimation];
}
}
];
}
-(void)viewDidAppear:(BOOL)animated{
//somewhere in your app, possibly viewDidLoad or viewDidAppear.
[self startAnimation];
}
ISSUE:动画和完成同时显示。我的错误在哪里。请帮我。