selecting alternative first view controller from story board at application startup

后端 未结 4 1300
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 08:04

I\'ve just started on iOS programming and so far the tutorials and answers I found here have been a great help to move forward. However, this particular problem has been bum

4条回答
  •  清歌不尽
    2020-12-29 08:48

    With the main storyboard already loaded, it's just a matter of finding its reference so that I can instantiate another root view controller:

    UIStoryboard *mainStoryboard = self.window.rootViewController.storyboard;
    
    self.window.rootViewController = [mainStoryboard 
        instantiateViewControllerWithIdentifier:@"view-controller-id"];
    

提交回复
热议问题