我想在10秒内将我的UIProgressView进度从0到1动画. 
  
 
码:
[UIView animateWithDuration:10.0 animations:^{
    [_myProgressView setProgress:1 animated:YES];
} completion:(BOOL finished)^{
    if (finished) NSLog(@"animation finished);
}]; 
 动画工作正常,除了完成和NSLog总是瞬间调用.
我试过animateWithDuration:withDelay:但延迟不被尊重并立即执行.
有人遇到同样的问题吗?
谢谢你的帮助
解决方法
 这是一个老问题,但我仍然在这里发布解决方案.解决方案的确很简单. 
 
所有你需要做的是:
        所有你需要做的是:
[_myProgressView setProgress:1];
[UIView animateWithDuration:10.0 animations:^{
    [_myProgressView layoutIfNeeded];
} completion:^(BOOL finished){
    if (finished) NSLog(@"animation finished");
}]; 
 这是一个很好的解释,为什么事情正在为你工作不正确:
http://blog.spacemanlabs.com/2012/08/premature-completion-an-embarrassing-problem/
所以你不能使用setProgress:animated:方法为进度视图动画化,并获得完成块的所需行为.但是,只是在块内设置进度将不会动画化,因为进度不是一个动画的属性.
请参阅苹果文档,说明该属性必须具有动画性:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/clm/UIView/animateWithDuration:animations:
所以你只需更新动画块外的进度属性的值,然后在动画块内部进行视图的布局.