Perform push segue after an unwind segue

前端 未结 7 2373
失恋的感觉
失恋的感觉 2020-12-05 02:24

I am working on a camera app where the camera views are shown modally. After I am done with cropping. I perform an unwind segue to the MainPageViewController. (

7条回答
  •  没有蜡笔的小新
    2020-12-05 02:57

    The exit segue IBAction method happens before the actual unwind segue is finished. I had the same issue and resolved it this way (if you don't mind my paraphrasing of your code). It avoids the extra time and animations from relying on ViewDidAppear.

    @IBAction func unwindToMainMenu(segue: UIStoryboardSegue) {
       let categoriesTable = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("CategoryTableViewController")
       self.navigationController?.viewControllers.append(categoriesTable)
       self.navigationController?.showViewController(categoriesTable, sender: self)
    }
    

    Hope this is helpful for anyone else who runs into this and just wants an instantaneous transition!

提交回复
热议问题