when i create a new project selecting option (single view application) in xcode 5, it automatically add Main.storyboard there is no option for selecting .Xib file as we select in previous version of xcode. Please someone explain this
My suggestion is:
File/New/File
, Choose Objective-C ClassName your class ViewController
(or whatever you like), make it subclass of UIViewController
Make sure you have checked the box "with xib for user interface."
Open appDelegate.h
, put
@class ViewController;
between @interface and #import
, and this property below:
@property (strong, nonatomic) UIViewController *viewController;
appDelegate.m:
import your ViewController #import "ViewController.h"
and before
[self.window makeKeyAndVisible];
put
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With