Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rubymotion - the introduction

.mateus
October 14, 2013

Rubymotion - the introduction

My RuPy talk on Rubymotion...

.mateus

October 14, 2013
Tweet

More Decks by .mateus

Other Decks in Programming

Transcript

  1. About Me  seanlilmateus  Mateus Armando Deutsche Telekom AG

    MacRuby & Rubymotion enthusiastic Mobile OS Geek Montag, 14. Oktober 13
  2.  seanlilmateus  @lrz MacRuby 7 years of experience at

    Apple Mac OS X IDA Pro GNOME Laurent Sansonetti RubyCocoa RubyMotion iLife The Initiator Montag, 14. Oktober 13
  3.  seanlilmateus  Open-Classes Objective-C • Objective-C is using “Categories”

    •Implementation : @implementation NSNumber (TimeDiff) - (NSNumber *)days { return [NSNumber numberWithInteger:([self intValue] * 24 * 60 * 60)]; } - (NSDate *)ago { return [NSDate dateWithTimeIntervalSinceNow:[self intValue]]; } @end Ruby(Motion) class Fixnum def days self * 24 * 60 60 end def ago Time.now - self end end Montag, 14. Oktober 13
  4.  seanlilmateus  Mixins Objective-C • No mixins available in

    ObjC language • Runtime Implementation : class_addMethod(Class cls, SEL name, IMP imp, const char *types); Ruby(Motion) module CapitalNames def capitalized_name name.upcase end end class User include CapitalNames def initialize name @name = name end def name @name end end Montag, 14. Oktober 13
  5. Thinking In A Foreign Language Helps You Make Rational Decisions.

     Science Thursday, April 26th 2012 at 3:10 pm Montag, 14. Oktober 13
  6.  seanlilmateus  Ruby ways Objective-C NSFileManager *mgr = [NSFileManager

    defaultManager]; NSArray *paths =[mgr contentsOfDirectoryAtPath:@"/etc" error:nil]; [paths enumerateObjectsUsingBlock:^(id obj, ...) { NSLog(@"%@", obj); }]; Ruby(Motion) Dir["/etc"].each do |name| puts name end Montag, 14. Oktober 13
  7.  seanlilmateus  Learning from ObjC Objective-C [string drawAtPoint:point withFont:font];

    Ruby(Motion)string.drawAtPoint(point, withFont:font) Montag, 14. Oktober 13