본문 바로가기
iOS/Mac

[iOS] XIB 이용한 SingleView 만들기

by CodeDiver 2013. 11. 30.

1.AppDelegate.h에 


#import <UIKit/UIKit.h>


@class ViewController;


@interface AppDelegate : UIResponder <UIApplicationDelegate>


@property (strong, nonatomic) UIWindow *window;


@property (strong, nonatomic) ViewController *viewController;


@end




2. AppDelegate.m 에

#import "AppDelegate.h"

#import "ViewController.h"


@implementation AppDelegate


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

{

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.

    self.window.backgroundColor = [UIColor whiteColor];

    [self.window makeKeyAndVisible];

    

    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];

    self.window.rootViewController = self.viewController;

    

    return YES;

}