Develop

[ios] StoryBoard(xib) 없이 프로젝트 만들기

by hooni posted Feb 12, 2015
?

Shortcut

PrevPrev Article

NextNext Article

ESCClose

Larger Font Smaller Font Up Down Go comment Print

AppDelegate.h

#import <UIKit/UIKit.h>
#import "MainViewController.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navigationController;
@property (strong, nonatomic) MainViewController *mainViewController;

@end


AppDelegate.m

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    self.window = [[UIWindow alloc]
        initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    
    self.mainViewController = [[MainViewController alloc] init];
    self.navigationController = [[UINavigationController alloc]
        initWithRootViewController:_mainViewController];
    //[self.navigationController setNavigationBarHidden:YES];
    self.window.rootViewController = _navigationController;
    [self.window makeKeyAndVisible];
    
    return YES;
}

...

@end