$30 off During Our Annual Pro Sale. View Details »

RubyMotion: Hack Your iOS App Like Never Before

Joseph Ku
December 08, 2012

RubyMotion: Hack Your iOS App Like Never Before

* Talk @ RubyConf Taiwan 2012 (2012.12.08)

Joseph Ku

December 08, 2012
Tweet

More Decks by Joseph Ku

Other Decks in Technology

Transcript

  1. RubyConf Taiwan
    RubyMotion
    HACK YOUR IOS APP LIKE NEVER BEFORE

    View Slide

  2. Who Am I?

    View Slide

  3. ຑพ፡

    View Slide

  4. !KPTFQILV

    View Slide

  5. View Slide

  6. WHAT’S
    RUBYMOTION?
    A Ruby toolchain for iOS
    Develop and test native iOS app in Ruby
    Based on MacRuby
    Laurent Sansonetti (@lrz)

    View Slide

  7. Why RubyMotion?

    View Slide

  8. View Slide

  9. Objective-C
    Objective-C Runtime
    iOS SDK
    Foundation Framework

    View Slide

  10. Objective-C
    Objective-C Runtime
    iOS SDK
    Foundation Framework
    RubyMotion

    View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. WHY RUBYMOTION?
    100% native code
    Keep your editor
    App Store compliant

    View Slide

  15. Babe, Let’s Rock!!

    View Slide

  16. Dirty

    View Slide

  17. Dirty

    View Slide

  18. The Last Mile

    View Slide

  19. DEPLOYMENT
    Deploy your app to beta testers by TestFlight
    Deploy to App Store
    $ rake archive:distribution
    $ gem install motion-testflight
    $ rake testflight notes='Orz'

    View Slide

  20. // Foo.h
    @interface Foo: NSObject
    {
    }
    @property (nonatomic, strong) NSString *bar;
    @end
    // Foo.m
    #import “Foo.h”
    @implementation Foo
    @synthesize bar = _bar;
    @end
    class Foo
    attr_accessor :bar
    end
    Objective-C
    RubyMotion

    View Slide

  21. outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:ba
    seAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shoul
    dColorMatch:
    WTF!!

    View Slide

  22. NSDictionary *rules = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber NumberWithBool:TRUE],"RubyIsAwesome",nil];
    Objective-C
    RubyMotion
    rules = { RubyIsAwesome: 1 }
    What’s the magic??

    View Slide

  23. Babe, Rock Again!!

    View Slide

  24. LIMITATIONS
    require
    eval
    define_method
    Proc#binding
    Regular gems don’t work

    View Slide

  25. PROS & CONS
    One-time fee of $199
    Growing faster and faster
    Apple’s attitude

    View Slide

  26. Is RubyMotion the future?

    View Slide

  27. %4-

    View Slide

  28. App.alert("BubbleWrap is awesome!")
    App.run_after(0.5) { p "It's #{Time.now}" }
    App.open_url("http://rubyconf.tw/2012/")
    Device.iphone?
    Device.ipad?
    Device.front_camera?
    BW::Media.play_modal("http://www.hrupin.com/wp-content/
    uploads/mp3/testsong_20_sec.mp3")
    EM.add_timer 1.0 do
    puts "Great scott!"
    end

    View Slide

  29. View Slide

  30. View Slide

  31. 3VCZ.JOF

    View Slide

  32. View Slide

  33. View Slide

  34. IS THE RUBYMOTION
    THE FUTURE?
    DSL
    Well-known editor and IDE Support
    Active community

    View Slide

  35. C’mon, it’s Ruby!!

    View Slide

  36. Any questions?

    View Slide

  37. 5IBOLZPV

    View Slide