いっつも忘れるので記録。
- シングルViewアプリケーションでプジェクトを作成
- Main.storyborardを削除(MoveToTrash)
- Info.plistの Main storyboard file base nameを空にする
- FileでView(xib)ファイルをつくる。ViewController.xibとする
- ViewController.xibのFile’s OwnerのCustom ClassをViewControllerにする
- ViewController.xibのFile’s OwnerのoutletのviewをIB上のviewをつなげる
- AppDelegate.hとAppDelegate.mを以下のように変更する
AppDelegate.hに以下のプロパティを加える
#import "ViewController.h" @property (strong, nonatomic) ViewController *viewController; @property (strong, nonatomic) UINavigationController *navigationController;
AppDelegate.mに以下を追加
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.viewController = [[ViewController alloc] initWithNibName:nil bundle:nil]; _navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController]; _navigationController.navigationBarHidden = true; [self.window setRootViewController:_navigationController]; [self.window makeKeyAndVisible]; return YES; }
でビルドでいいとおもう・・・