Sie sind auf Seite 1von 37

C y b u R

n a iw Ta f n o

RubyMotion
HACK YOUR IOS APP LIKE NEVER BEFORE

Who Am I?

@josephku

WHATS RUBYMOTION?
A Ruby toolchain for iOS Develop and test native iOS app in Ruby Based on MacRuby Laurent Sansonetti (@lrz)

Why RubyMotion?

iOS SDK

Foundation Framework Objective-C Runtime

Objective-C

iOS SDK

Foundation Framework Objective-C Runtime

RubyMotion

Objective-C

WHY RUBYMOTION?

100% native code Keep your editor App Store compliant

Babe, Lets Rock!!

Dirty

Dirty

The Last Mile

DEPLOYMENT
Deploy your app to beta testers by TestFlight
$ gem install motion-testflight $ rake testflight notes='Orz'

Deploy to App Store


$ rake archive:distribution

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

RubyMotion
class Foo attr_accessor :bar end

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

Objective-C
NSDictionary *rules = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber NumberWithBool:TRUE],"RubyIsAwesome",nil];

RubyMotion
rules = { RubyIsAwesome: 1 }

Whats the magic??

Babe, Rock Again!!

LIMITATIONS
require eval dene_method Proc#binding Regular gems dont work

PROS & CONS

One-time fee of $199 Growing faster and faster Apples attitude

Is RubyMotion the future?

DSL

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

RubyMine

IS THE RUBYMOTION THE FUTURE?


DSL Well-known editor and IDE Support Active community

Cmon, its Ruby!!

Any questions?

Thank you!

Das könnte Ihnen auch gefallen