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_nav_bar_button :right, title: "Help", action: :open_help_screen
end
def open_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
def tapped_about(args={})
open AboutScreen
end
def log_out
# 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
- Watch the excellent MotionInMotion screencast about ProMotion (very reasonably priced subscription required)
- Follow a tutorial: Building an ESPN app using RubyMotion, ProMotion, and TDD
- Now uses motion-require for better compatibility with other libraries 6046dd7f4
- SplitScreen: New option
swipe:
allows you to specify if a splitscreen master screen can be opened with a swipe. ffbb76caf - FormotionScreen: Removed
PM::FormotionScreen
and the Formotion testing dependency. Use ProMotion-formotion instead. - Styling: Added a
content_width
helper to PM::Styling (similar tocontent_height
) 08a984815 - TableScreen: Removed SDWebImage in favor of similar but more reliable JDImageCache 59ed747e9
- Screen: Allow custom views (including images) for
title
setting #415
We've created a comprehensive and always updated wiki with code examples, usage examples, and API reference.
ProMotion is not only an easy DSL to get started. The community is very helpful and welcoming to new RubyMotion developers. We don't mind newbie questions.
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