mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-17 12:20:25 +08:00
[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:
2
NEWS
2
NEWS
@@ -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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
class AppDelegate
|
||||
def application(application, didFinishLaunchingWithOptions:launchOptions)
|
||||
true
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user