Check out the "RubyMotion success stories" on the blog, you'll see that a lot of very successful apps are using RubyMotion, like BaseCamp, Frontback, Jukely, Cabify.
This list is the best place to get answers to RubyMotion questions, but you should also rely on Stack Exchange. Usually, answers to Obj-C questions will also apply to RubyMotion. If something is REALLY frustrating you, please email me or another HipByte employee directly (Eloy Durán, Joffrey Jaffeux, Shizuo Fujita aka Watson), we'll do our best to get your question answer or issue resolved. The RubyMotion creator Laurent Sansonetti is also available, though I would ask that you talk to me or someone else first.
There are some popular gems you should check out, to see if you might find them useful:
- Promotion by Jamon Halmgren and Mark Rickert
- Formotion by Clay Allsopp
- BubbleWrap by Matt Aimonetti, Clay, and Marin Usalj
- Teacup by Conrad Irwin and myself
- SugarCube by myself and MANY people from this list
- Geomotion by Clay Allsopp and myself
- MotionModel by Steve Ross
- Futuristic by Mateus Armando
- ...what others am i forgetting? there are lots of gems. search for "motion" in rubygems, many of those are RubyMotion gems.
- plus the main CocoaPods developer, Eloy Durán, is a HipByte employee. We can already include CocoaPods easily.
Now the cons!
At the moment, the biggest bug/quirk I know of is around blocks (not surprising; they are a complicated feature in ANY language). Right now, if you retain a block, you immediately create a retain cycle that will NOT be detected by the cycle detector. The reason is that the block keeps a reference to the object it was created in (this is a good thing; it allows callbacks to work correctly even when the object that created the callback has "gone away", like a view-controller that is no longer visible).
The only way out of the mess is to nil-ify the reference to the block. The most common case is in a view controller, where you might have a block that is called by a button press (the 'SugarCube' gem introduces idioms to make this very easy, I'll demonstrate that here)
def button
unless @button
# a button at (0,0), width 100, height 20
@button = UIButton.alloc.initWithFrame([[0, 0], [100, 20]])
@button.setTitle('Push!', forState: UIControlStateNormal)
end
return @button
end
# this method is called from `viewWillAppear`
def attach_handlers
# attach an 'on touch' handler
@button.on :touch do
self.tapped_a_button
end
@text_field.on :change do
# and so on...
end
end
The controller retains the view, the view retains the 'on-touch block', and the block retains the controller. boo. So when the controller is "going away", you need to detach the handler.
def dettach_handlers
@button.off :touch
@text_field.off
end
This will be resolved in a future version of the compiler, which come around every month or so (there are no set release dates, new versions are released when they are ready).
Ready for mainstream? I vote yes! I earn most of my bread as an iOS app developer, and I use RubyMotion exclusively. I did both Xcode/RubyMotion for a while, but I got so sick of the Xcode workflow, I gave up on it.
So welcome! :-D
Colin T.A. Gray
Community Manager
HipByte