Skip to content

Instantly share code, notes, and snippets.

@vishnugopal
Created May 23, 2012 17:40
Show Gist options
  • Save vishnugopal/2776589 to your computer and use it in GitHub Desktop.
Save vishnugopal/2776589 to your computer and use it in GitHub Desktop.
A Rubymotion Storyboard Delegate that automatically loads the initial storyboard (marked with identifier "Start")
class StoryboardDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
storyboard = UIStoryboard.storyboardWithName("Storyboard", bundle: NSBundle.mainBundle)
viewController = storyboard.instantiateViewControllerWithIdentifier("Start")
if self.respond_to?("initializeRootViewController:forApplication:launchedWithOptions:")
viewController = initializeRootViewController(viewController, forApplication:application, launchedWithOptions:launchOptions)
end
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = viewController
@window.makeKeyAndVisible
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment