0
我試圖寫我自己的自定義UIStoryboardSegue
其中UIView
從sourceViewController
「滑」到destinationViewController
。目前,我的代碼如下:自定義UIStoryboardSegue不工作
- (void)perform {
UIViewController *sourceViewController = self.sourceViewController;
UINavigationController *navigationController = [[self sourceViewController] navigationController];
RestaurantViewController *destinationViewController = self.destinationViewController;
destinationViewController.colors.frame = CGRectMake(0, 0, 10, 10);
[sourceViewController.view addSubview:destinationViewController.tables];
[UIView animateWithDuration:10.0
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
destinationViewController.tables.frame = CGRectMake(100, 100, 100, 100);
}
completion:^(BOOL finished){
[destinationViewController.tables removeFromSuperview]; // remove from temp super view
[navigationController pushViewController:destinationViewController animated:NO]; // present VC
}];
}
作爲一個測試,我只是玩弄表視圖的框架。我還將持續時間設置爲10秒鐘,以便我能看到所有內容。但是,destinationViewController
只是完成了,完全忽略了我寫的所有代碼。我在這裏做錯了什麼?