在我的项目中,程序在查询数据库时会触发一个动画,当它接收到响应数据时,它会自动触发另一个动画来显示数据。
-(void)queryDatabase{
//...querying database ...
[UIView animateWithDuration:0.4
delay:0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
//...first animation block...
}
completion:^(BOOL finished){
//...first completion block...
}];
}
-(void)receivedResponse:(NSData *)responseData{
[UIView animateWithDuration:0.4
delay:0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
//...second animation block...
}
completion:^(BOOL finished){
//...second completion block...
}];
}
我的问题是,当程序启动并在第一次收到响应时触发第二个动画,“第二个动画块”完全执行,但“第二个完成块”没有执行,直到大约 20 屏幕才改变或更多秒过去了。之后,当再次调用此循环时,第二个动画将始终正常工作。怎么修?