2
我有一個UIViewController應控制2周的UIImageViews淡入在沒有濫用[UIView animateWithDuration]的情況下觸發延遲後的方法?
我管理使用的UIView animateWithDuration方法即可製作動畫,這樣的:
[UIView animateWithDuration:1.5
animations:^{
[mFrontpageTitle setAlpha:0];
[mFrontpageTitle setAlpha:1];
}
completion:^(BOOL finished){
[self AnimatePause];
}];
和
-(void)AnimatePause {
[UIView animateWithDuration:5.0
animations:^{
[mFrontpageTitle setAlpha:0.99];
[mFrontpageTitle setAlpha:1];
}
completion:^(BOOL finished){
[self AnimateAuthor];
}];
其中火災下一個動畫。現在,創建一個從.99到1.0的轉換並不是很乾淨。
是否有更好的方法通過定義持續時間來觸發塊或發送消息?
感謝
Zuppa
謝謝。我已經看到了完全錯誤的方向。我會看到,如果這個崩潰,如果UIView在間隔完成之前被刪除.. :) – Zuppa
如果我想調用一個方法,需要兩個參數?例如:' - (void)MoveSomethigFrom:(id)from To:(id)to;' – Frade
或者將你的方法包裝在只需要一個參數的東西(例如帶有所有參數的字典)中,或者使用'dispatch_after '(例子見[這裏](http://stackoverflow.com/a/4139331/573626))。 – omz