Skip to content

Instantly share code, notes, and snippets.

@chsh
Created May 7, 2012 10:18
Show Gist options
  • Save chsh/2627056 to your computer and use it in GitHub Desktop.
Save chsh/2627056 to your computer and use it in GitHub Desktop.
Example to use UIWebView for RubyMotion.
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame UIScreen.mainScreen.bounds
@window.rootViewController = GoogleViewController.alloc.init
@window.makeKeyAndVisible
true
end
end
class GoogleViewController < UIViewController
def viewDidLoad
self.view = UIWebView.alloc.init
url = NSURL.URLWithString("http://www.google.co.jp/")
request = NSURLRequest.requestWithURL(url)
self.view.loadRequest request
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment