Más contenido relacionado Similar a RubyMotion: Hack Your iOS App Like Never Before (20) RubyMotion: Hack Your iOS App Like Never Before1. an
Taiw
nf
C o
by
Ru
RubyMotion
HACK YOUR IOS APP LIKE NEVER BEFORE
6. WHAT’S
RUBYMOTION?
A Ruby toolchain for iOS
Develop and test native iOS app in Ruby
Based on MacRuby
Laurent Sansonetti (@lrz)
10. iOS SDK
Foundation Framework
Objective-C Runtime
RubyMotion Objective-C
19. DEPLOYMENT
Deploy your app to beta testers by TestFlight
$ gem install motion-testflight
$ rake testflight notes='Orz'
Deploy to App Store
$ rake archive:distribution
20. 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
22. Objective-C
NSDictionary *rules = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber NumberWithBool:TRUE],"RubyIsAwesome",nil];
RubyMotion
rules = { RubyIsAwesome: 1 }
What’s the magic??
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
34. IS THE RUBYMOTION
THE FUTURE?
DSL
Well-known editor and IDE Support
Active community