jjzjj

unwindSegue

全部标签

ios - UIViewController 的委托(delegate)函数决定弹出

我在NavigationStack中有3个ViewController,分别是ViewControllerA、ViewControllerB和ViewControllerC。当我从ViewControllerB按下后退按钮时,我到达了ViewControllerA。我想检查我是如何到达ViewControllerA的,是通过弹出还是作为导航堆栈的rootViewController。 最佳答案 你可以给你的backButton一个unwind函数并在ViewController中捕获它。@IBActionfuncunwindToVi

ios - 难以理解 Obj-C MVC : exit and unwindSegue

创建了一个按钮,用于从第二个ViewController退出到前一个ViewController。我在教程中读到这应该通过在ViewController中使用“EXIT”来实现。(control+点击+拖动按钮退出)。我在第二个Controller上创建了一个“退出”按钮,并在ViewController类上创建了一个方法来连接control+click+dragexitsegue。这个方法完全是空的:-(IBAction)unwindToMainMenu:(UIStoryboardSegue*)unwindSegue{}然而,当我按下按钮时,它会按我的预期返回到之前的ViewCont