Last active
December 15, 2015 06:09
-
-
Save makevoid/5214609 to your computer and use it in GitHub Desktop.
Hello (UIViewController) world - RubyMotion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AppDelegate | |
| def application(application, didFinishLaunchingWithOptions:launchOptions) | |
| player_controller = MainController.alloc.init | |
| window = UIWindow.alloc.initWithFrame UIScreen.mainScreen.bounds | |
| window.rootViewController = player_controller | |
| window.rootViewController.wantsFullScreenLayout = true | |
| window.makeKeyAndVisible | |
| true | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MainController < UIViewController | |
| def viewDidLoad | |
| button = UIButton.buttonWithType UIButtonTypeRoundedRect | |
| button.setTitle "Hello world", forState: UIControlStateNormal | |
| button.frame = CGRectMake 80.0, 210.0, 160.0, 40.0 | |
| self.view.addSubview button | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment