Xcode / iOS - link for ViewController in AppDelegate

It seems to me that the iPad application uploads the storyboard file with it to the ViewController. I see an entry in the plist file for "Primary file name of the main storyboard."

Based on the background where I used the "Empty Application" in Xcode, and then I would create a UIViewController along with the nib file, create an instance inside

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 

and add to the view and I reference (variable) this ViewController object

Now in this โ€œsingle view applicationโ€ I donโ€™t see the links to the ViewController based on the storyboard, and I need to have a link to some work. please inform.

+4
source share
1 answer

Check this question for some sample code on accessing a view controller through a storyboard - Accessing a view controller created using a storyboard using an application delegate

For a basic answer, you should be able to refer to the "window" property. You should be able to use the properties of the window link to link to your other views. There is a "rootViewController" property associated with UIWindow.

UIWindow documentation - http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html

+4
source

Source: https://habr.com/ru/post/1416412/


All Articles