ViewController Appears to Transition Twice

前端 未结 4 1618
孤街浪徒
孤街浪徒 2021-02-10 05:23

Problem Summary

My mainVC --> second VC transtion appears to run twice. However, what\'s odd is that the second VC\'s viewDidLoad only runs once. This i

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-10 05:45

    I found Elena's answer (on this thread Pushing View Controller Twice) to be a time saving quick fix by simply checking if the navigation controller already contains the ViewController you want to push to.

    if !(self.navigationController!.viewControllers.contains(editView)){
    self.navigationController?.pushViewController(editView, animated:true)
    

    }

提交回复
热议问题