* Talk @ RubyConf Taiwan 2012 (2012.12.08)
RubyConf TaiwanRubyMotionHACK YOUR IOS APP LIKE NEVER BEFORE
View Slide
Who Am I?
ຑพ፡
!KPTFQILV
WHAT’SRUBYMOTION?A Ruby toolchain for iOSDevelop and test native iOS app in RubyBased on MacRubyLaurent Sansonetti (@lrz)
Why RubyMotion?
Objective-CObjective-C RuntimeiOS SDKFoundation Framework
Objective-CObjective-C RuntimeiOS SDKFoundation FrameworkRubyMotion
WHY RUBYMOTION?100% native codeKeep your editorApp Store compliant
Babe, Let’s Rock!!
Dirty
The Last Mile
DEPLOYMENTDeploy your app to beta testers by TestFlightDeploy 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;@endclass Fooattr_accessor :barendObjective-CRubyMotion
outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shouldColorMatch:WTF!!
NSDictionary *rules = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber NumberWithBool:TRUE],"RubyIsAwesome",nil];Objective-CRubyMotionrules = { RubyIsAwesome: 1 }What’s the magic??
Babe, Rock Again!!
LIMITATIONSrequireevaldefine_methodProc#bindingRegular gems don’t work
PROS & CONSOne-time fee of $199Growing faster and fasterApple’s attitude
Is RubyMotion the future?
%4-
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 doputs "Great scott!"end
3VCZ.JOF
IS THE RUBYMOTIONTHE FUTURE?DSLWell-known editor and IDE SupportActive community
C’mon, it’s Ruby!!
Any questions?
5IBOLZPV