Xcode6
has removed the Empty Application
template when creating a new project. How can we create an empty application (without Storyboard) in Xcode6
and above, like in earlier versions?
There is no option in XCode6
and above versions for directly creating an Empty Application as in XCode5
and earlier. But still we can create an application without Storyboard
by following these steps:
Single View Application
.Main.storyboard
and LaunchScreen.xib
(select them, right-click, and choose to either
remove them from the project, or delete them completely).Info.plist
file.Swift 3 and above:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
{
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.white
self.window?.makeKeyAndVisible()
return true
}
Swift 2.x:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window?.backgroundColor = UIColor.whiteColor()
self.window?.makeKeyAndVisible()
return true
}
Objective-C:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.rootViewController = [[ViewController alloc] init];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}