Navigation Controller Loop

前端 未结 2 1633
花落未央
花落未央 2020-12-04 01:06

I\'m making an app which has a shopping cart feature. The shopping cart VC is accessible from several VCs via a button on the navigation bar. So far I only have one

2条回答
  •  旧巷少年郎
    2020-12-04 01:24

    Awesome.

    In these scenarios you should use setViewControllers([UIViewController], animated: Bool) to get the desired viewcontrollers in the stack when you get many controllers stacked up in cycles.

    Other way is you write your own class derived from UINavigationController having methods, pushToCheckout(animated:Bool), popToEditCart(animated:Bool) , removeIntermediateControllers()

提交回复
热议问题