We believe iPhone development should be clean, scalable, and fast with a language that developers not only enjoy, but actively choose. With the advent of Ruby for iPhone development the RubyMotion community has combined and tested the most active and powerful gems into a single package called RedPotion
RedPotion combines RMQ, ProMotion, CDQ, AFMotion, and MotionPrint. It also adds new features to better integrate RMQ with ProMotion. The goal is simply to choose standard libraries and promote best practices, allowing you to develop iOS apps in record time.
=========
The makers of RMQ at InfiniteRed and the creators of ProMotion at ClearSight as well as David Larrabee have teamed up to create the ultimate RubyMotion library.
ProMotion for screens and RMQ for styles, animations, traversing, events, etc.
You can use both RMQ Plugins and ProMotion Add-ons
gem install redpotion
potion create my_app
bundle
rake pod:install
rake
gem install redpotion
If you use rbenv
rbenv rehash
add it to your Gemfile
:
gem 'redpotion'
Do NOT use RedPotion from github, we don't know why, but it will throw exceptions if you do; we're currently investigating why.
Our new generates allow you to create your ProMotion screen and stylesheet template to let you hit the ground running. Currently the following RedPotion generators exist:
potion create screen foo
potion create table_screen foo
potion create view foo
# All rmq generators work with the potion command as well
potion create model foo
potion create shared foo
potion create lib foo
# rmq controller generators also still exist
# but screens are preferred to get the redpotion value
potion create controller foo
potion create collection_view_controller foos
potion create table_view_controller bars
# RedPotion includes CDQ and afmotion by default, if you don't need these gems
# we have provided command line tasks to remove either of them
potion remove cdq
potion remove afmotion
find.all.hide
find(my_view).children.nudge(right: 10)
So you also get window, device, and delegate from that.
app.device
app.window
app.delegate
append
append!
prepend
prepend!
create
create!
build
build!
on
apply_style
reapply_styles
style
color
image
stylesheet
stylesheet=
You can specify the stylesheet in your screen like so:
class HomeScreen < PM::Screen
title "RedPotion"
stylesheet HomeStylesheet
def on_load
end
end
You can use either rmq_build or on_load, they do exactly the same thing. You can only use one or the other. on_load
is preferred as it matches the screen's onload.
class Section < UIView
def on_load
apply_style :section
append(UIButton, :section_button).on(:touch) do
mp "Button touched"
end
end
end
ProMotion 2.2.0 added on_load and on_styled to match RedPotion
UIColor has a with
method. Allowing you to build a color from an existing color easily
# for example that time you want your existing color, but with a slight change
color.my_custom_color.with(a: 0.5)
- Create an issue in GitHub to make sure your PR will be accepted.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request