Skip to content

Instantly share code, notes, and snippets.

@aiwilliams
Created May 16, 2012 13:52

Revisions

  1. aiwilliams created this gist May 16, 2012.
    3 changes: 3 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's ```resources``` directory. Add a UIViewController, and set it's identifier property to ```"Start"```. Add some UI elements so you can see it working.

    When you run rake in your RubyMotion project, it will compile the ```.storyboard``` file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.
    12 changes: 12 additions & 0 deletions app_delegate.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    class AppDelegate
    def application(application, didFinishLaunchingWithOptions:launchOptions)
    storyboard = UIStoryboard.storyboardWithName("Storyboard", bundle: NSBundle.mainBundle)
    view_controller = storyboard.instantiateViewControllerWithIdentifier("Start")

    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.applicationFrame)
    @window.rootViewController = view_controller
    @window.makeKeyAndVisible

    true
    end
    end