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

Using Ruby for Building iOS Apps

Amit Kumar
February 22, 2013

Using Ruby for Building iOS Apps

Amit Kumar

February 22, 2013
Tweet

More Decks by Amit Kumar

Other Decks in Technology

Transcript

  1. AU  Ruby  Conference ABOUT ME ★ Ruby’ist ★ IT  Architect:

     McKinsey  &  Co ★ Github:  toamitkumar ★ Twi=er:  toamit ★ toamitkumar.com 2 Friday, February 22, 13
  2. AU  Ruby  Conference RUBYMOTION 5 revolutionary toolchain for native iOS

    application development using Ruby language Friday, February 22, 13
  3. AU  Ruby  Conference RUBYMOTION 5 revolutionary toolchain for native iOS

    application development using Ruby language Friday, February 22, 13
  4. AU  Ruby  Conference RUBYMOTION 5 revolutionary toolchain for native iOS

    application development using Ruby language triumph of Utilitarianism; reduces suffering Friday, February 22, 13
  5. AU  Ruby  Conference 6 RUBYMOTION ? ★ Fork  of  MacRuby

    ★ Compiles  Ruby  Code  into  optimized  machine  code Friday, February 22, 13
  6. AU  Ruby  Conference 6 RUBYMOTION ? ★ Fork  of  MacRuby

    ★ Compiles  Ruby  Code  into  optimized  machine  code ★ Ruby  runtime  tightly  integrated  with  Obj-­‐‑C  runtime Friday, February 22, 13
  7. AU  Ruby  Conference 6 RUBYMOTION ? ★ Fork  of  MacRuby

    ★ Compiles  Ruby  Code  into  optimized  machine  code ★ Ruby  runtime  tightly  integrated  with  Obj-­‐‑C  runtime ★ Same  ancestors  as  Obj-­‐‑C Friday, February 22, 13
  8. AU  Ruby  Conference 6 RUBYMOTION ? ★ Fork  of  MacRuby

    ★ Compiles  Ruby  Code  into  optimized  machine  code ★ Ruby  runtime  tightly  integrated  with  Obj-­‐‑C  runtime ★ Same  ancestors  as  Obj-­‐‑C ★ Objects  can  be  shared  with  no  performance  cost Friday, February 22, 13
  9. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method 10 Friday, February 22, 13
  10. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method 10 Friday, February 22, 13
  11. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval 10 Friday, February 22, 13
  12. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval 10 Friday, February 22, 13
  13. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get 10 Friday, February 22, 13
  14. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get ★ const_defined? 10 Friday, February 22, 13
  15. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get ★ const_defined? 10  require   Friday, February 22, 13
  16. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get ★ const_defined? 10  require   Friday, February 22, 13
  17. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get ★ const_defined? 10  eval    require   Friday, February 22, 13
  18. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get ★ const_defined? 10  eval    require   Friday, February 22, 13
  19. AU  Ruby  Conference CAN I USE EVAL ? ★ method_missing

    ★ define_method ★ alias_method ★ instance_eval ★ class_eval ★ const_get ★ const_defined? 10  eval    require   Friday, February 22, 13
  20. AU  Ruby  Conference DE-BUGGING 21 GDB RubyMine launched with RubyMotion

    support - including debugging Friday, February 22, 13
  21. AU  Ruby  Conference DE-BUGGING 21 GDB RubyMine launched with RubyMotion

    support - including debugging Friday, February 22, 13
  22. AU  Ruby  Conference RUBYMOTION GEMS 23 ★ Normal  RubyGems  will

     not  work ★ Load  RubyMotion  Gems  in  Rakefile Friday, February 22, 13
  23. AU  Ruby  Conference RUBYMOTION GEMS 23 ★ Normal  RubyGems  will

     not  work ★ Load  RubyMotion  Gems  in  Rakefile Friday, February 22, 13
  24. AU  Ruby  Conference RUBYMOTION GEMS 23 ★ Normal  RubyGems  will

     not  work ★ Load  RubyMotion  Gems  in  Rakefile source  :rubygems gem  ‘rake’ gem  ‘bubble-­‐‑wrap’ gem  ‘motion-­‐‑cocoapods’ Gemfile Friday, February 22, 13
  25. AU  Ruby  Conference RUBYMOTION GEMS 23 ★ Normal  RubyGems  will

     not  work ★ Load  RubyMotion  Gems  in  Rakefile source  :rubygems gem  ‘rake’ gem  ‘bubble-­‐‑wrap’ gem  ‘motion-­‐‑cocoapods’ Gemfile Friday, February 22, 13
  26. AU  Ruby  Conference RUBYMOTION GEMS 23 ★ Normal  RubyGems  will

     not  work ★ Load  RubyMotion  Gems  in  Rakefile source  :rubygems gem  ‘rake’ gem  ‘bubble-­‐‑wrap’ gem  ‘motion-­‐‑cocoapods’ Gemfile require  ‘  bundler’ Bundler.require  :default Motion::Project::App.setup  do  |app|    #more  stuff end Rakefile Friday, February 22, 13
  27. AU  Ruby  Conference SOME LIBRARIES 24 ★ BubbleWrap ★ Sugarcube

    ★ Formotion ★ Teacup ★ motion-­‐‑stump ★ motion-­‐‑addressbook ★ Pixate ★ MotionModel ★ NanoStoreInMotion ★ Teacup ★ motion-­‐‑ocr ★ .... Friday, February 22, 13
  28. AU  Ruby  Conference SOME LIBRARIES 24 ★ BubbleWrap ★ Sugarcube

    ★ Formotion ★ Teacup ★ motion-­‐‑stump ★ motion-­‐‑addressbook ★ Pixate ★ MotionModel ★ NanoStoreInMotion ★ Teacup ★ motion-­‐‑ocr ★ .... Friday, February 22, 13
  29. AU  Ruby  Conference PIXATE 25 ★ Style  your  iOS  controls

     using  CSS .header-bar { background-­‐‑color: #288de3; } .header-title { background-­‐‑color: none; color: rgba(255, 255, 255, 0.6); font-­‐‑family: "Open Sans"; font-­‐‑weight: light; } .header-bu!on { background-­‐‑color: none; color: white; font-­‐‑family: "Open Sans"; }..... ....... ......... Friday, February 22, 13
  30. AU  Ruby  Conference COCOAPODS 28 ★ dependency  manager  for  Obj-­‐‑C

     projects ★ distributed  as  a  rubygem Friday, February 22, 13
  31. AU  Ruby  Conference COCOAPODS 28 ★ dependency  manager  for  Obj-­‐‑C

     projects ★ distributed  as  a  rubygem Friday, February 22, 13
  32. AU  Ruby  Conference COCOAPODS 28 ★ dependency  manager  for  Obj-­‐‑C

     projects ★ distributed  as  a  rubygem Friday, February 22, 13
  33. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Friday, February 22, 13
  34. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Friday, February 22, 13
  35. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Friday, February 22, 13
  36. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Complex  C  Data  Structures Friday, February 22, 13
  37. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Complex  C  Data  Structures Friday, February 22, 13
  38. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Complex  C  Data  Structures Ruby  data  types (Not  Data  Type) Friday, February 22, 13
  39. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Complex  C  Data  Structures Ruby  data  types (Not  Data  Type) Friday, February 22, 13
  40. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Complex  C  Data  Structures Ruby  data  types (Not  Data  Type) BridgeSupport Friday, February 22, 13
  41. AU  Ruby  Conference NATIVE C 30 Basic  types  in  C

    (bool,  char,  long,  float,  double) Ruby  data  types (true/false,  Fixnum,  Bignum,  Float Complex  C  Data  Structures Ruby  data  types (Not  Data  Type) RubyMotion BridgeSupport Friday, February 22, 13
  42. AU  Ruby  Conference TESTING 32 ★ Comes  bundled  with  RSpec

     like  like  framework  -­‐‑  ‘MacBacon’ Friday, February 22, 13
  43. AU  Ruby  Conference TESTING 32 ★ Comes  bundled  with  RSpec

     like  like  framework  -­‐‑  ‘MacBacon’ ★ RSpec  syntactic  sugar ★ Assertions ★ Matchers ★ before/aOer  blocks Friday, February 22, 13
  44. AU  Ruby  Conference TESTING 32 ★ Comes  bundled  with  RSpec

     like  like  framework  -­‐‑  ‘MacBacon’ ★ RSpec  syntactic  sugar ★ Assertions ★ Matchers ★ before/aOer  blocks ★ View  testing: Friday, February 22, 13
  45. AU  Ruby  Conference TESTING 32 ★ Comes  bundled  with  RSpec

     like  like  framework  -­‐‑  ‘MacBacon’ ★ RSpec  syntactic  sugar ★ Assertions ★ Matchers ★ before/aOer  blocks ★ View  testing: ★ nib/storyboard/  file Friday, February 22, 13
  46. AU  Ruby  Conference TESTING 32 ★ Comes  bundled  with  RSpec

     like  like  framework  -­‐‑  ‘MacBacon’ ★ RSpec  syntactic  sugar ★ Assertions ★ Matchers ★ before/aOer  blocks ★ View  testing: ★ nib/storyboard/  file Friday, February 22, 13