[iOS Template] Add view controllers and window to new apps.

Besides being a more helpful entry point, it also ensures that when
users build an application without any window they do not get to
see ugly warnings about unhandled touch events.

Fixes http://hipbyte.myjetbrains.com/youtrack/issue/RM-339
This commit is contained in:
Eloy Durán
2014-11-11 14:48:34 +01:00
parent 2f9e5a12c9
commit 6eda9d1d35
3 changed files with 17 additions and 5 deletions

2
NEWS
View File

@@ -1,5 +1,7 @@
= RubyMotion 2.39 =
* [iOS] Create a `UIViewController`, `UINavigationController`, and `UIWindow`
in the default new application template.
* [iOS] Enabled arm64 support by default for iOS projects.
* [iOS] Honour explicit `device_name` or `target` specified by user.
Specifying both is disallowed, because a device is configured for a

View File

@@ -1,5 +0,0 @@
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
true
end
end

View File

@@ -0,0 +1,15 @@
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
rootViewController = UIViewController.alloc.init
rootViewController.title = '<%= name %>'
rootViewController.view.layer.backgroundColor = UIColor.whiteColor.CGColor
navigationController = UINavigationController.alloc.initWithRootViewController(rootViewController)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = navigationController
@window.makeKeyAndVisible
true
end
end