Swift 3: Chage ViewController withOut Segue and send AnyObject Use: Identity MainPageViewController on target ViewController
let mainPage = self.storyboard?.instantiateViewController(withIdentifier: "MainPageViewController") as! MainPageViewController
var mainPageNav = UINavigationController(rootViewController: mainPage)
self.present(mainPageNav, animated: true, completion: nil)
or if you want to Change View Controller and send Data
let mainPage = self.storyboard?.instantiateViewController(withIdentifier: "MainPageViewController") as! MainPageViewController
let dataToSend = "**Any String**" or var ObjectToSend:**AnyObject**
mainPage.getData = dataToSend
var mainPageNav = UINavigationController(rootViewController: mainPage)
self.present(mainPageNav, animated: true, completion: nil)