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
Screens | Navigation Bars | Tab Bars |
---|---|---|
Table Screens | Grouped Tables | Searchable | Refreshable |
---|---|---|---|
iPad SplitScreens | Map Screens | Web Screens |
---|---|---|
Check out the Getting Started Guide in the wiki!
- Added a ProMotion executable called
promotion
. You can typepromotion 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
, andset_attributes
to call a method with that name to get styles. - Added
button_title:
toopen_split_screen
to customize the auto-generated button title - Updates to set_tab_bar_button
- Added to PM::Delegate
on_open_url(args = {})
whereargs
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
forbar_button_item
s. - Added
will_begin_search
andwill_end_search
callbacks to PM::TableScreen. - Added
title_view
andtitle_view_height
to sections in PM::TableScreen. - Updated screenshots for iOS 7
- Refactored code and lots of new passing tests
Shows how to make a basic app in ProMotion. Updated in May.
http://www.clearsightstudio.com/insights/ruby-motion-promotion-tutorial
Shows how to create a Youtube app that shows Portland Trailblazer highlights.
http://www.clearsightstudio.com/insights/tutorial-make-youtube-video-app-rubymotion-promotion/
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
We've created a comprehensive and always updated wiki with code examples, usage examples, and API reference.
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.
See CONTRIBUTING.md.
- Jamon Holmgren: @jamonholmgren
- Silas Matson: @silasjmatson
- Matt Brewer: @macfanatic
- Mark Rickert: @markrickert
- Many others
- Run
git shortlog -s -n -e
to see everyone who has contributed.