Created
January 9, 2014 22:18
-
-
Save willrax/8343126 to your computer and use it in GitHub Desktop.
URL Scheme Management (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) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@viewController = Foo.alloc.init | |
@window.rootViewController = @viewController | |
@window.rootViewController.wantsFullScreenLayout = true | |
@window.makeKeyAndVisible | |
true | |
end | |
def application(application, openURL:url, sourceApplication:sourceApp, annotation:annotation) | |
# Here's where you might parse the url and decide which view controller to use | |
controller = Bar.alloc.init | |
@viewController.presentModalViewController(controller, animated:true) | |
true | |
end | |
end | |
class Foo < UIViewController | |
def viewDidLoad | |
self.view = UIImageView.alloc.initWithImage(UIImage.imageNamed('foo.png')) | |
end | |
end | |
class Bar < UIViewController | |
def viewDidLoad | |
self.view = UIImageView.alloc.initWithImage(UIImage.imageNamed('bar.png')) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment