Hi Forum,
Clearly we can easily make a single view application which XCODE supplies us with nib files and one ViewController. I would like to know what a user has to do if he/she wants to start out with an EMPTY project and do all the preparation manually. This is solely for learning clearly not a practical thing. I have read a tutorial on it and it basically says:
step 1: create empty project
step 2: add the following to the appdelegate.h
step 3: create a view ( nib file)
step 4: Add the following to the - (BOOL)application: (UIApplication *)application didFinishLaunchingWithOptions
NSDictionary *)launchOptions method
step 5: update file Owner to the name of the viewcontroller class
step 6: connect view object in nib to fileowner
My question is:
are the following lines necessary? if so why?
Clearly we can easily make a single view application which XCODE supplies us with nib files and one ViewController. I would like to know what a user has to do if he/she wants to start out with an EMPTY project and do all the preparation manually. This is solely for learning clearly not a practical thing. I have read a tutorial on it and it basically says:
step 1: create empty project
step 2: add the following to the appdelegate.h
Code:
@class BIDSwitchViewController;
@property (strong, nonatomic) BIDSwitchViewController *switchViewController;
step 3: create a view ( nib file)
step 4: Add the following to the - (BOOL)application: (UIApplication *)application didFinishLaunchingWithOptions
Code:
self.switchViewController = [[BIDSwitchViewController alloc]initWithNibName:@"SwitchView" bundle:nil];
UIView *switchView = self.switchViewController.view;
CGRect switchViewFrame = switchView.frame;
switchViewFrame.origin.y = switchViewFrame.origin.y + [UIApplication sharedApplication].statusBarFrame.size.height;
switchView.frame = switchViewFrame;
self.window.rootViewController = self.switchViewController;
step 5: update file Owner to the name of the viewcontroller class
step 6: connect view object in nib to fileowner
My question is:
are the following lines necessary? if so why?
Code:
UIView *switchView = self.switchViewController.view;
CGRect switchViewFrame = switchView.frame;
switchViewFrame.origin.y = switchViewFrame.origin.y + [UIApplication sharedApplication].statusBarFrame.size.height;
switchView.frame = switchViewFrame;