iOS Segue - Left to Right -

前端 未结 11 1004
旧巷少年郎
旧巷少年郎 2020-11-30 20:40

I\'ve read the other posts on segues but none solve my question.

Simply put, my ViewControllers are ordered, like a book. I want backward transitions (

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 21:24

    It sounds like you are just trying to pop a view controller off the UINavigationController's stack, just like the default back button would.

    You can do one of two things. The easiest is to connect your custom back button to an IBAction that calls popViewControllerAnimated():

    @IBAction func tappedCustomBackButton(sender: AnyObject) {
        self.navigationController?.popViewControllerAnimated(true)
    }
    

    Or you can create an unwind segue from your second view controller back to your first.

提交回复
热议问题