gpt4 book ai didi

ios - 侧边菜单覆盖特定情况下的后退按钮

转载 作者:行者123 更新时间:2023-11-28 08:00:06 24 4
gpt4 key购买 nike

我正在使用 https://github.com/jonkykong/SideMenu它工作正常,但是,我想覆盖堆栈。

比如我有下一个流程?:

HomeViewController > MyBusinessViewController > TheBusinessXViewController > Add CategoryViewController > MyBusinessViewController (再次).

但是,当我返回到 MyBusinessViewController 时,后退按钮 正在重定向到之前的 ViewController,但我想删除所有堆栈并在那里有初始菜单(就像 HomeViewController)这可能吗?

拥有更自然的行为。

最佳答案

要将 Add CategoryViewController 排除到流程中,我们需要考虑以下几点:在 Add CategoryViewController 完成后,您想要:HomeViewController > MyBusinessViewController > TheBusinessXViewController

TheBusinessXViewController 将是要显示的 Controller ,然后:

let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "TheBusinessXVC") as! TheBusinessXViewController
nextVC.id = self.idtruck
nextVC.extraparameter = "StringOrInt"

let newViewController = self.storyboard?.instantiateViewController(withIdentifier: "HomeVC") as! HomeViewController
let sencondViewController = self.storyboard?.instantiateViewController(withIdentifier: "MyBusinessVC") as! MyBusinessViewController

let customViewControllersArray : NSArray = [newViewController, sencondViewController, nextVC]
self.navigationController?.viewControllers = customViewControllersArray as! [UIViewController]

self.navigationController?.pushViewController(nextVC, animated: true)

关于ios - 侧边菜单覆盖特定情况下的后退按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46896879/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com