iOS Switching an embedded view in storyboard

后端 未结 3 1068
予麋鹿
予麋鹿 2021-02-04 18:16

I have been trying to figure this out all day and I know it should be able to be done, but being new to iOS development using Objective-C and not Appcelerator I\'m having newbie

3条回答
  •  遇见更好的自我
    2021-02-04 18:24

    I wanted to do the same thing, and this is what I found.

    Creating Custom Container View Controllers

    The gist of it is you create a navigation controller that you embed into the container view, which allows you to navigate through several views as you wish.

    Here's a short example/walkthrough:

    1. Add a Navigation Controller to your Storyboard.
    2. Embed the Navigation Controller inside of the Container View.
    3. Select a view to be the root view controller of the navigation controller.
    4. Create manual segues for each view controller that will be used inside of the container view, INCLUDING THE ROOT VIEW CONTROLLER (I almost made the mistake of not adding this one). Make sure you name each segue you create.
    5. In your code, simply call the corresponding manual segue whenever you want to show a different view controller.

    Hope this helps!

提交回复
热议问题