简体   繁体   中英

Cannot go back - popViewControllerAnimated not working, swipe back not working too

I am new to iOS development. I created a segue from one VC to another VC. It is set as "Show(eg Push)"

在此处输入图片说明

However, swipe back capability is not working. Also, I have a custom back button. I have set a listener to it, which also does nothing:

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

What is wrong? I want back button to work and swipe back capability to also work. I don't need Navigation Bar.

Just Embed In navigation controller to your root view controller and hide your navigation bar if you don't need it. And your button action will work.

In my case, my project used split view controller. I removed it, and popViewController worked.

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