RubyMotion Introduction
Upcoming SlideShare
Loading in...5
×
 

RubyMotion Introduction

on

  • 891 views

RubyMotion talk by Marc Rendl Ignacio during the October 2012 PHRUG (Philippine Ruby User Group) meetup held at the AELOGICA office.

RubyMotion talk by Marc Rendl Ignacio during the October 2012 PHRUG (Philippine Ruby User Group) meetup held at the AELOGICA office.

Statistics

Views

Total Views
891
Views on SlideShare
891
Embed Views
0

Actions

Likes
2
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

RubyMotion Introduction RubyMotion Introduction Presentation Transcript

  • RubyMotionMaking iOS apps in Ruby
  • @pd_i
  • Prerequisites
  • Prerequisites Ruby MVC Objective-C* *optional
  • What isRubyMotion?
  • Ruby toolchain for iOS
  • Author:Laurent Sansonetti(MacRuby)
  • 1.9compliant
  • Something Objective-CObjective-C RuntimeFoundation Framework iOS SDK
  • RubyMotion Objective-CObjective-C RuntimeFoundation Framework iOS SDK
  • Different...
  • ...but the same Gary Oldman
  • Observations
  • ObjectsRubyMotionObjective-C
  • RubyMotion Objects# Ruby"PHRUG".class.ancestors=> [String, Comparable, Object, Kernel,BasicObject]# RubyMotion"PHRUG".class.ancestors=> [String, NSMutableString, NSString,Comparable, NSObject, Kernel]
  • RubyMotion Objects# RubyMotionObject == NSObject=> true
  • Objective-CRubyMotion Methods
  • RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];# RubyMotionstring = NSString.alloc.initWithString "PhRuG"
  • RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseString] => "PHRUG";# RubyMotionstring = NSString.alloc.initWithString "PhRuG"string.uppercaseString => "PHRUG"
  • 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"
  • NamedParameters
  • Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(point, withFont:font)# using sendstring .send(:"drawAtPoint:withFont:", point, font)
  • Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(point, withFont:font)# using sendstring .send(:"drawAtPoint:withFont:", point, font)
  • If theyre the same...
  • ... why use it?
  • GoodStuff
  • Power
  • Editor +Terminal
  • Rake
  • rake simulator
  • rake device
  • rake spec
  • Testing (MacBacon)
  • GarbageCollection
  • REPL(read-eval-print loop)
  • DSLs(domain specific languages)
  • Cocoapods
  • Disadvantages
  • 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)
  • Demo Time!
  • Questions?
  • Resources● 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 :) ]
  • Images● http://rubyidentity.org/● http://www.rubymotion.com/press/● developer.apple. com/technologies/mac/cocoa.html● cocoapods.org
  • Thanks!
  • Marc Ignaciotwitter: @pd_i github: @padi