How to call a View Controller programmatically?

前端 未结 8 2271
孤街浪徒
孤街浪徒 2020-12-02 07:04

I have looked at all the tutorials I can find on this one, and I still don\'t have the answer. I need to call another view from the code. I am using UIStoryboards

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-02 07:23

    There's 2 ways you can do this:

    1, Create a segue to your ViewController in your Storyboard as explained in my answer here: How to perform a segue that is not related to user input in iOS 5?

    2, Give your ViewController and identifier and call it using the code in my answer here: Call storyboard scene programmatically (without needing segue)?

提交回复
热议问题