ProMotion
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 Jamon Holmgren give a talk about ProMotion at RubyMotion #inspect2014 (video)
- Watch the September 2013 Motion Meetup where Gant Laborde interviews Jamon Holmgren about ProMotion
# app/app_delegate.rb
class AppDelegate < PM::Delegate
true, animation: :fade
def on_load(app, )
open RootScreen.new(nav_bar: true)
end
end
# app/screens/root_screen.rb
class RootScreen < PM::Screen
title "Root Screen"
def on_load
: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
Features
Screens | Navigation Bars | Tab Bars |
---|---|---|
Table Screens | Grouped Tables | Searchable | Refreshable |
---|---|---|---|
iPad SplitScreens | Map Screens | Web Screens |
---|---|---|
...and much more.
Getting Started
- 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
- Read the updated and exhaustive Wiki
Changelog
Version 2.2.0
This release includes several new features and is backwards compatible with all 2.x releases.
- PM::TableScreen: You can now set a custom table view header view (thanks Mark Rickert)
- PM::TableScreen refreshable: Refresh controls now show when programmatically initiating refresh (thanks Mark Rickert)
- PM::TableScreen: Added reorderable (thanks Mark Rickert)
- PM::TableScreen: Added auto height feature (thanks Carlin Isaacson)
- PM::Screen: The navigation controller bottom toolbar will auto-hide when passed nil or false (thanks Mark Rickert)
- PM::Screen: You can now choose a status bar style (thanks Mark Rickert)
- Added
on_load
andon_styled
hooks for UIViews that implement those methods (Jamon Holmgren) - Fixed an issue where cell properties would be applied twice unnecessarily (Jamon Holmgren)
API Reference
We've created a comprehensive and always updated wiki with code examples, usage examples, and API reference.
ProMotion API Reference
Help
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 open an issue on GitHub. If we don't respond within a day, tweet us a link to the issue -- sometimes we get busy.
Contributing
See CONTRIBUTING.md.
Primary Contributors
- Jamon Holmgren: @jamonholmgren
- Silas Matson: @silasjmatson
- Mark Rickert: @markrickert
- Ryan Linton: @ryanlntn
- Many others