Wednesday 12 April 2017

Swift programmatically navigate to another view controller with navigation bar with back button / without navigation bar



Navigate to another view controller with navigation bar with backbutton

 let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)

let vc = storyBoard.instantiateViewController(withIdentifier: "secondviewcontrollerid") as! secondviewcontroller
        
vc.message="value"
       
self.navigationController?.pushViewController(vc, animated: true)


-----------------------------------------------------------------------------------------------------------------------

        


Navigate to another view controller without navigation bar

let vc=storyBoard.instantiateViewController(withIdentifier: "secondviewcontrollerid"assecondviewcontroller
        
vc.message="value"
       
self.present(vc, animated: true, completion: nil)

No comments:

Post a Comment

Remove bottom line in navigation bar

navigationController ?. navigationBar . setBackgroundImage ( UIImage (), for: . any , barMetrics: . default )          navigat...