Skip to content

Instantly share code, notes, and snippets.

@cpreston
Last active August 29, 2015 13:59
Show Gist options
  • Save cpreston/10487273 to your computer and use it in GitHub Desktop.
Save cpreston/10487273 to your computer and use it in GitHub Desktop.
Xibs instead of StoryboardsAppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
MainViewController *mainViewController = [[MainViewController alloc] init];
self.window.rootViewController = mainViewController;
[self.window makeKeyAndVisible];
return YES;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// assumes the nib names are "RootViewController~iPhone.xib and "RootViewController~iPad.xib"
RootViewController *rootViewController = [[RootViewController alloc] init];
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
@interface AppDelegate()
@property (strong, nonatomic) UINavigationController *navigationController;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// assumes the nib names are "RootViewController~iPhone.xib and "RootViewController~iPad.xib"
RootViewController *rootViewController = [[RootViewController alloc] init];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
[self.window setRootViewController:self.navigationController];
[self.window makeKeyAndVisible];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment