How to use navigation controller in iOS swift

How to use navigation controller in iOS swift
April 9, 2020 No Comments Development,iOS Development Pushpendra Kumar

Hello Guys, Welcome to this tutorial. I hope you are doing well. Here once again I came with a new wonderful trick. Which is as How to use a navigation controller in iOS swift. In this tutorial, I will make you understand the navigation controller. And also I will tell you about how you can use the navigation controller in iOS with swift language.

Navigation controller in iOS

At the very first, I will make you understand about navigation controller. The procedure of open one controller to another controller and come back to the same view controller, This procedure can happen with the help of the navigation controller. You have to create one project if you are working from the beginning. If you are not working from the beginning then you can start as usual. Below I am writing few steps to achieve the first task for the navigation controller.

  • Click on your main view controller and follow the steps as mention into the below image.
  • how to use navigation controller
  • Wonderful 😊😊😊, Now you have added navigation controller. So next you just have to navigate the another controller from the button click.
  • I have one more controller with name DetailController.
  • how to use navigation controller

With the help of the above procedure, you can open another controller without the button click. But if you want to open the controller with the help of a button click then write the below code on the button click.

@IBAction func open(_ sender: Any) {
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "DetailController") as! DetailController
        self.navigationController?.pushViewController(vc,animated: true)
    }

😊😊😊

Wonderful, Great, In Conclusion You have done with the main task. If you are still facing any issue related with this then watch this video 😎😎😎. If you are looking for more topic then below are the links.

Tags
About The Author
Pushpendra Kumar I am passionate about mobile application development and professional developer at Colour Moon Technologies Pvt Ltd (www.thecolourmoon.com). This website I have made so that I can meet with new challenges and can share here.

Leave a reply

Your email address will not be published.