Monday 5 October 2015

StoryBoard Reference in Xcode 7


If you have multiple Storyboard in your project if you want to navigate from one storyboard to other storyboard until Xcode 6.4 you have to use this code  :

first make object of storyboard , then make object of that storyboard's view controller

      self.myProfileStoryboard = [UIStoryboard storyboardWithName:@"MyProfile"
                                                        bundle: nil];
     
      self.homeNavC = (AHKNavigationController*)[self.homeStoryboard
 
                                             instantiateViewControllerWithIdentifier: @"HomeViewControllerIDNavCntrl"];



But now in Xcode 7 you can use  Storyboard Reference


1) Make one storyboard , add one navigationController and add one ViewController name it FirstViewController

















2) In First Storyboard add one storyboard Reference as under

3) Add  one ViewController in  second storyboard 
4) In second storyboard gave StoryboardId - SecondViewID for that viewController 






5)  Select FirstView Controller and gave the values as under:



Thats you done run your project and you can see you can navigate from one storyboard to another storyboard using StoryBoard Reference.


But this project you can not open now in previous xcode if you open you will see following error 








No comments:

Post a Comment