i've noticed..

2013, Jan 06

Beginning RubyMotion!

For 2013, the company I work for is encouraging each developer to take time to work on a personal project. Something of our own creation where we drive the vision, requirements and breakdown of work.

For my project, I’ve decided that I’d like to create an iOS app. I’ve already released five different apps on the App Store at a previous company and even saw some success reaching the top 10 in iPad Sports apps. Even so, I had no clue what I was doing and the experience was more about getting it done than understanding iOS development. This time around, my goal is to learn more completely how to create an iOS application.

But I’ve done Objective-C. I’ve used Xcode. It’s a nightmare. It’s not a fun tool to use. Luckily there is RubyMotion, a way to learn about iOS development, without leaving the tools I’m comfortable with. RubyMotion is a toolchain that allows developing iOS apps in not-quite Ruby (more on that later).

For my benefit and hopefully the benefit of somebody else out there, I’m going to blog my progress through RubyMotion: The bumps in the road, the lessons learned, random thoughts, results and code.

What Have I Already Learned

I’ve already begun writing a small bit of RubyMotion. What have I learned already?

First, it is really simple to get a basic app started. You can type ‘motion create MyApp’, add a few lines and have an app that actually does something rudimentary.

Speaking of adding a few lines. Using vim to edit iOS apps is great! I’m sure I could technically use vim for regular Objective-C iOS apps, but it certainly feels out of the realm of accepted procedures.

On first glance, the documentation is meh. Most everything available for RubyMotion, even through the official site, is paid content. There aren’t a lot of people using it, so there aren’t a lot of people writing about it. I have found RubyMotion Tutorial, which looks incredibly promising. I will update on that later.

You still have to understand the iOS frameworks. You won’t be able to just pick up RubyMotion and assume that, because you know Ruby, you’re set. You’ll immediately find references to the framework, with UIAlertView’s and UIWindow’s. The framework is heavy and you have access to it all. There’s still a learning curve.

Finally, RubyMotion isn’t quite Ruby and still kind of ugly. The methods are written to look like Objective-C, with a weird Ruby syntax that won’t even pass ‘ruby -c’.

def application(application, didFinishLaunchingWithOptions:launchOptions)

This method is the equivalent of an Objective-C method called application:didFinishLaunchingWithOptions. That’s all still there. Just Ruby-fied. Kinda.

What’s Next

The progress came slowly over the past few weeks with the Holidays, but I should get beyond a “Hello World” app this week. I will start a GitHub repo just for this blog series and keep my progress there.

  1. justinreese posted this