Search This Blog

Monday, October 24, 2016

iOS Swift. How Programmatically go back to previous ViewController


To go back to Root View Controller:
@IBAction func goToFirst(_ sender: AnyObject) {
        let _ = self.navigationController?.popToRootViewController(animated: true)
    }

To go back to previous View Controller:
@IBAction func showPrev(_ sender: AnyObject) {
        let _ = self.navigationController?.popViewController(animated: true)
    }

7 comments:

  1. I've read your post thank you for sharing this post. It is very informative post. keep sharing waiting for another.
    -Custom Web Design

    ReplyDelete
  2. After a long time i found a unique and on purpose information about Custom Designed Websites. Can't wait to have more from you.

    ReplyDelete
  3. This post wowed me with its well-researched content and excellent writing. Because I was so involved in this book, I couldn't put it down. Your work and ability have wowed me. Thank you very much. Those who want to learn more about it may find it useful. Best Custom Websites

    ReplyDelete
  4. Thank you very much for drawing my notice to this. Your blog is jam-packed with useful facts. Until I read that, I would have no idea. I'll come back for more fantastic material.
    Best wishes, and good luck.
    Web Design USA

    ReplyDelete
  5. Good content. I was looking for this type of content. Saved my time for further search.
    You should always provide that type of content. I appreciate your determination to give the students a good title.Custom Designed Websites

    ReplyDelete
  6. Thank you so much for your post; it has provided us with an excellent idea.
    SEO Firm USA

    ReplyDelete
  7. Amazing write-up! The blog was very informative. Keep it up!
    Custom Website Development

    ReplyDelete