Opening viewController programmatically in swift

后端 未结 3 1775
粉色の甜心
粉色の甜心 2021-02-07 13:27

I want to open new UIViewController on the button through code. I have already made the controller in storyboard and just want to link it and also I don\'t want to use XIB inter

3条回答
  •  悲哀的现实
    2021-02-07 13:44

    self.navigationController!.pushViewController(self.storyboard!.instantiateViewControllerWithIdentifier("userProfileController") as UIViewController, animated: true)
    

    I wanted to add my view controller to the navigation controller and this also worked

提交回复
热议问题