Skip to content

Commit

Permalink
[iOS Template] Add view controllers and window to new apps.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alloy authored and Watson1978 committed Dec 11, 2014
1 parent 5d35b8b commit ffe9511
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/motion/project/template/ios/files/app/app_delegate.rb

This file was deleted.

15 changes: 15 additions & 0 deletions lib/motion/project/template/ios/files/app/app_delegate.rb.erb
@@ -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

0 comments on commit ffe9511

Please sign in to comment.