简体   繁体   中英

Can not go back once I start UIViewController

I'm starting a new UIViewController with

let myViewController = MyViewController()
navigationController?.pushViewController(myViewController, animated: true)

But then on my MyViewController() I do not see the arrow to go back, what I'm missing?.

I think that there are 2 solutions to go back.

  1. You should use Navigation Controller.
    • Then, make the RootViewController, and connect other ViewController to RootViewController by Seague.
    • Then, pesent the ViewController by performSegue from the current ViewController(RootViewController).

在此处输入图片说明

在此处输入图片说明

  1. You can also implement the back by NavItem.

如果您不在 MyViewController 类中使用 init 方法,请使用故事板标识符加载 MyViewController()。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM