rubymotion introduction
DESCRIPTION
RubyMotion talk by Marc Rendl Ignacio during the October 2012 PHRUG (Philippine Ruby User Group) meetup held at the AELOGICA office.TRANSCRIPT
![Page 1: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/1.jpg)
RubyMotionMaking iOS apps in Ruby
![Page 2: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/2.jpg)
@pd_i
![Page 3: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/3.jpg)
![Page 4: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/4.jpg)
Prerequisites
![Page 5: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/5.jpg)
Prerequisites
Ruby MVCObjective-C*
*optional
![Page 6: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/6.jpg)
What isRubyMotion?
![Page 7: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/7.jpg)
![Page 8: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/8.jpg)
![Page 9: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/9.jpg)
Ruby toolchain for iOS
![Page 10: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/10.jpg)
Author:Laurent Sansonetti
(MacRuby)
![Page 11: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/11.jpg)
1.9compliant
![Page 12: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/12.jpg)
Objective-C RuntimeFoundation Framework
iOS SDK
Objective-C
Something
![Page 13: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/13.jpg)
Objective-C RuntimeFoundation Framework
Objective-C
iOS SDK
RubyMotion
![Page 14: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/14.jpg)
Different...
![Page 15: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/15.jpg)
...but the same
GaryOldman
![Page 16: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/16.jpg)
Observations
![Page 17: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/17.jpg)
RubyMotionObjective-C Objects
![Page 18: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/18.jpg)
RubyMotion Objects# Ruby"PHRUG".class.ancestors=> [String, Comparable, Object, Kernel, BasicObject]
# RubyMotion"PHRUG".class.ancestors=> [String, NSMutableString, NSString, Comparable, NSObject, Kernel]
![Page 19: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/19.jpg)
RubyMotion Objects# RubyMotionObject == NSObject=> true
![Page 20: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/20.jpg)
Objective-CRubyMotion Methods
![Page 21: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/21.jpg)
RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];
# RubyMotionstring = NSString.alloc.initWithString "PhRuG"
![Page 22: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/22.jpg)
RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseString] => "PHRUG";# RubyMotionstring = NSString.alloc.initWithString "PhRuG"string.uppercaseString => "PHRUG"
![Page 23: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/23.jpg)
RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseString] => "PHRUG";# RubyMotionstring = NSString.alloc.initWithString "PhRuG"string.uppercaseString => "PHRUG"# we can still use ruby methods!string.upcase => "PHRUG"
![Page 24: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/24.jpg)
Named Parameters
![Page 25: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/25.jpg)
Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(point, withFont:font)# using sendstring
.send(:"drawAtPoint:withFont:", point, font)
![Page 26: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/26.jpg)
Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(point, withFont:font)# using sendstring
.send(:"drawAtPoint:withFont:", point, font)
![Page 27: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/27.jpg)
If they're the
same...
![Page 28: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/28.jpg)
... why use it?
![Page 29: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/29.jpg)
Good
Stuff
![Page 30: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/30.jpg)
Power
![Page 31: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/31.jpg)
Editor+
Terminal
![Page 32: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/32.jpg)
Rake
![Page 33: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/33.jpg)
rake simulator
![Page 34: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/34.jpg)
rake device
![Page 35: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/35.jpg)
rake spec
![Page 36: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/36.jpg)
Testing(MacBacon)
![Page 37: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/37.jpg)
Garbage Collection
![Page 38: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/38.jpg)
REPL(read-eval-print loop)
![Page 39: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/39.jpg)
DSLs(domain specific languages)
![Page 40: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/40.jpg)
Cocoapods
![Page 41: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/41.jpg)
Disadvantages
![Page 42: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/42.jpg)
Disadvantages● Cost
○ $199.99 with 1 year updates○ $99 per year to continue updates
● Most resources are in Objective-C● Not an excuse to not learn Objective-C● No RubyMotion Book (yet)
![Page 43: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/43.jpg)
Demo Time!
![Page 44: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/44.jpg)
Questions?
![Page 45: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/45.jpg)
● rubymotion.com● rubymotion.com/developer-center● slideshare.net/markvilla/macruby-rubymotion-
madridrb-may-2012-13154591● http://www.slideshare.net/clayallsopp/preview-
unicorns-magic-and-better-apps-with-rubymotion [for the Gary Oldman metaphor :) ]
Resources
![Page 46: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/46.jpg)
Images● http://rubyidentity.org/● http://www.rubymotion.com/press/ ● developer.apple.
com/technologies/mac/cocoa.html● cocoapods.org
![Page 47: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/47.jpg)
Thanks!
![Page 48: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/48.jpg)
Marc Ignaciotwitter: @pd_i github: @padi
![Page 49: RubyMotion Introduction](https://reader033.vdocuments.mx/reader033/viewer/2022052823/55519919b4c905013a8b4ad1/html5/thumbnails/49.jpg)