User Tools

Site Tools


objective-c:examples:rootviewcontroller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

objective-c:examples:rootviewcontroller [2012/12/20 12:24]
objective-c:examples:rootviewcontroller [2024/02/16 01:06] (current)
Line 1: Line 1:
 +====== RootViewController ======
 +Add a UIViewController named RootViewController to your empty project
 +
 +
 +===== Add a RootViewController to your project =====
 +
 +First step import the RootViewController.h in your AppDelegate
 +<code objc>
 +#import "RootViewController.h"
 +</code>
 +
 +Second step initialize and add the RootViewController to window
 +<code objc>
 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 +{
 +    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
 +    // Override point for customization after application launch.
 +    
 +    /* initialize RootViewController */
 +    RootViewController *rootVC = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
 +
 +    /* Add RootViewController */
 +    self.window.rootViewController = rootVC;
 +    
 +    self.window.backgroundColor = [UIColor whiteColor];
 +    [self.window makeKeyAndVisible];
 +    return YES;
 +}
 +</code>
  

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War

Impressum Datenschutz