.
你好
我正在尝试为我的故事板制作一个自定义 Segue。现在我注意到,似乎一个 segue 只能走一条路。
这是真的吗?或者我可以在那里设置一个if/else语句吗?
我已经尝试过这个,但是在初始选项卡/单击按钮后变得毫无用处。
我错过了什么吗?
我有点心里有这个想法。在评论区域,我有代码,但我遵循这个想法的原则。
- (void) perform{
CGFloat ledge = 25;
CGSize screenSize = UIScreen.mainScreen.bounds.size;
BOOL left = TRUE;
MainViewController *src = (MainViewController *) self.sourceViewController;
SideMenuVC *dst = (SideMenuVC *) self.destinationViewController;
// [src presentViewController:dst animated:YES completion:nil];
[src.navigationController pushViewController:dst animated:YES];
if(left){
//Do the first thing, but the view is still partly in the screen
}else {
//Return to original place
}
}
不幸的是,
UISegues只是一种方式。您必须手动关闭模态 UIViewController,或使用 popViewControllerAnimated: for UINavigationController。