ProMotion Build Status Code Climate

iPhone Apps, Ruby-style

ProMotion is a RubyMotion gem that makes iOS development more like Ruby and less like Objective-C. It introduces a clean, Ruby-style syntax for building screens that is easy to learn and remember and abstracts a ton of boilerplate UIViewController, UINavigationController, and other iOS code into a simple, Ruby-like DSL.

Watch the September Motion Meetup where Gant Laborde interviews Jamon Holmgren about ProMotion!

# app/app_delegate.rb
class AppDelegate < PM::Delegate
  def on_load(app, options)
    open RootScreen.new(nav_bar: true)
  end
end

# app/screens/root_screen.rb
class RootScreen < PM::Screen
  title "Root Screen"

  def on_load
    set_bar_button :right, title: "Help", action: :push_help_screen
  end

  def push_help_screen
    open HelpScreen
  end
end

# app/screens/help_screen.rb
class HelpScreen < PM::TableScreen
  title "Table Screen"

  def table_data
    [{
      title: "Help",
      cells: [
        { title: "About this app", action: :tapped_about },
        { title: "Log out", action: :log_out }
      ]
    }]
  end
end

Features

Screens Navigation Bars Tab Bars
ProMotion Screen ProMotion Nav Bar ProMotion Tabs
Table Screens Grouped Tables Searchable Refreshable
ProMotion TableScreen Grouped Table Screen Searchable Refreshable
iPad SplitScreens Map Screens Web Screens
ProMotion SplitScreens MapScreen ProMotion WebScreen

...and much more.

Getting Started

Check out the Getting Started Guide in the wiki!

What's New?

Version 1.1.x

  • Added a ProMotion executable called promotion. You can type promotion new <myapp> and it will create a ProMotion-specific app. We will be adding more functionality in the future.
  • Can now pass a symbol to add, add_to, and set_attributes to call a method with that name to get styles.
  • Added button_title: to open_split_screen to customize the auto-generated button title
  • Updates to set_tab_bar_button
  • Added to PM::Delegate on_open_url(args = {}) where args contains :url, :source_app, and :annotation
  • Added to PM::Delegate tint_color to customize the application-wide tint color
  • Added to PM::MapScreen annotations the ability to set an image
  • Removed legacy navigation_controller references which were causing confusion.
  • Allowed setting a custom_view for bar_button_items.
  • Added will_begin_search and will_end_search callbacks to PM::TableScreen.
  • Added title_view and title_view_height to sections in PM::TableScreen.
  • Updated screenshots for iOS 7
  • Refactored code and lots of new passing tests

Tutorials

Shows how to make a basic app in ProMotion. Updated in May.

http://www.clearsightstudio.com/insights/ruby-motion-promotion-tutorial

Screencasts

Shows how to create a Youtube app that shows Portland Trailblazer highlights.

http://www.clearsightstudio.com/insights/tutorial-make-youtube-video-app-rubymotion-promotion/

Sample Apps

Here's a demo app that is used to test new functionality. You might have to change the Gemfile source to pull from Github.

https://github.com/jamonholmgren/promotion-demo

Here's a demo app showing some styling options.

https://github.com/jamonholmgren/promotion-styling

API Reference

We've created a comprehensive and always updated wiki with code examples, usage examples, and API reference.

ProMotion API Reference

Help

If you need help, feel free to tweet @jamonholmgren or open an issue on GitHub. Opening an issue is usually the best and we respond to those pretty quickly. If we don't respond within a day, tweet Jamon or Mark a link to the issue.

Contributing

See CONTRIBUTING.md.

Primary Contributors