Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a small iOS app with RubyMotion

Building a small iOS app with RubyMotion

My talk was given at the Brisbane Ruby and Rails Brigade on the 25 June, 2012. Code is available at https://github.com/tatey/posts

Tate Johnson

June 24, 2012
Tweet

More Decks by Tate Johnson

Other Decks in Programming

Transcript

  1. Why? • I’m an iOS guy in an office of

    Rubyists. • Xcode is getting better, but it’s slow and crashes. I prefer the command line and a text editor. • Compiles down to native LLVM byte code. It’s fast. • Ruby! It’s just nice to look at and write.
  2. Why not? • Biggest barrier to iOS is Cocoa, not

    Objective-C. • Everything is documented in Objective-C. Cannot avoid it entirely. • Understanding C/Objective-C and Cocoa would actually make you a better RubyMotion developer. • No type-safety. • Not supported by Apple. Business confidence.
  3. If there was more time... • Testing MacBacon • Persistence

    CoreData, SQLite • Internationalization String literals, Storyboards • Programatically creating views loadView, UIView, drawRect
  4. Tidbits • Not MRI/CRuby MacRuby is its own implementation using

    the Objective-C runtime. That is, Cocoa classes with Ruby methods. • Strange Cocoa conventions for a Rubyist Out parameters and the Pointer class versus the exception workflow. • Ruby Method missing and modules work like you’d expect. • Memory management Works similar to ARC. Pretty much don’t worry about it, but every objet allocation has a cost. You have MBs of memory, not GBs.
  5. Resources • Code https://github.com/tatey/posts • RubyMotion Developer Center http:// www.rubymotion.com/developer-center/

    • RubyMotion Cookbook https://github.com/ IconoclastLabs/rubymotion_cookbook • Stanford: iPad and iPhone Application Development http://itunes.apple.com/itunes-u/ipad- iphone-application-development/id473757255?mt=2 • MacRuby: The Definitive Guide http:// ofps.oreilly.com/titles/9781449380373/