0
我分類爲UIStoryboardSegue
以執行自定義節奏動畫。爲了使動畫可見,我必須添加目標爲ViewController
的視圖作爲臨時視圖。執行動畫後,我將刪除臨時視圖並通過(presentViewController:animated:NO)呈現最終的ViewController
。如何實現自定義segue動畫?
然而這會導致以下警告:「不平衡呼叫開始/結束外觀轉換爲」。
如果我保留我的臨時視圖並且不刪除它,警告不會出現,但最終視圖不再響應觸摸事件。如何擺脫這個警告?
我的自定義代碼賽格瑞:
-(void)perform {
UIViewController *sourceViewController = self.sourceViewController;
UIViewController *destinationViewController = self.destinationViewController;
destinationViewController.view.alpha = 0.;
destinationViewController.view.transform = CGAffineTransformScale(destinationViewController.view.transform, 4.0, 4.0);
[sourceViewController.view addSubview:destinationViewController.view];
[UIView animateWithDuration:kSSSpriteKitFadeOutDuration
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
destinationViewController.view.transform = CGAffineTransformScale(destinationViewController.view.transform, 0.25, 0.25);
destinationViewController.view.alpha = 1.;
}
completion:^(BOOL finished){
[destinationViewController.view removeFromSuperview]; // remove from temp super view
[sourceViewController presentViewController:destinationViewController animated:NO completion:NULL]; // present VC
}];
}
不能拿這個作爲一個答案。問題依然存在。它會導致相同的警告! – 2014-09-24 12:10:58
它對我的工作很好。 – 2014-09-24 12:12:28