rubymotion: hack your ios app like never before

Post on 15-May-2015

890 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

* Talk @ RubyConf Taiwan 2012 (2012.12.08)

TRANSCRIPT

RubyCo

nf Taiw

an

RubyMotionHACK YOUR IOS APP LIKE NEVER BEFORE

Who Am I?

古傑芳

@josephku

WHAT’S RUBYMOTION?

A Ruby toolchain for iOS

Develop and test native iOS app in Ruby

Based on MacRuby

Laurent Sansonetti (@lrz)

Why RubyMotion?

Objective-C

Objective-C Runtime

iOS SDK

Foundation Framework

Objective-C

Objective-C Runtime

iOS SDK

Foundation Framework

RubyMotion

WHY RUBYMOTION?

100% native code

Keep your editor

App Store compliant

Babe, Let’s Rock!!

Dirty

Dirty

The Last Mile

DEPLOYMENT

Deploy your app to beta testers by TestFlight

Deploy to App Store

$ rake archive:distribution

$ gem install motion-testflight

$ rake testflight notes='Orz'

// 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 :barend

Objective-C

RubyMotion

outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shoul

dColorMatch:

WTF!!

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

Objective-C

RubyMotionrules = { RubyIsAwesome: 1 }

What’s the magic??

Babe, Rock Again!!

LIMITATIONS

require

eval

define_method

Proc#binding

Regular gems don’t work

PROS & CONS

One-time fee of $199

Growing faster and faster

Apple’s 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

C’mon, it’s Ruby!!

Any questions?

Thank you!

top related