Successfully reported this slideshow.
Your SlideShare is downloading. ×

Ruby, Meet iPhone

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Kotlin L → ∞
Kotlin L → ∞
Loading in …3
×

Check these out next

1 of 76 Ad

Ruby, Meet iPhone

Download to read offline

RubyMotion transports the dynamic language ethos and Ruby language to iOS all at once. The language is flexible and dynamic. Instead of in dialogs, configuration happens in a text file using a simple internal Ruby DSL. Apps running in the simulator include a REPL for code evaluation. There’s even a built-in way to click on object in an app for dynamic introspection and manipulation. In this talk, we’ll introduce RubyMotion, the platform’s development tools and workflow, and third-party libraries that push the state of the art in iOS developer tools. We’ll show some example apps and reflect on experiences building real-world production apps in Ruby.

RubyMotion transports the dynamic language ethos and Ruby language to iOS all at once. The language is flexible and dynamic. Instead of in dialogs, configuration happens in a text file using a simple internal Ruby DSL. Apps running in the simulator include a REPL for code evaluation. There’s even a built-in way to click on object in an app for dynamic introspection and manipulation. In this talk, we’ll introduce RubyMotion, the platform’s development tools and workflow, and third-party libraries that push the state of the art in iOS developer tools. We’ll show some example apps and reflect on experiences building real-world production apps in Ruby.

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Viewers also liked (20)

Advertisement
Advertisement

Recently uploaded (20)

Ruby, Meet iPhone

  1. 1. Drew Colthorp www.atomicobject.com iPhone, meet Ruby
  2. 2. @atomicobject http://spin.atomicobject.com A Tour of RubyMotion • Implementation of Ruby • Similar object model to Objective C, natural language for the platform • UNIX Ethos • Very Flexible
  3. 3. From our app directory, we can run our app in the simulator with a simple command.
  4. 4. From-scratch implementation of Ruby. Started by apple in 2007.
  5. 5. © HipByte SPRL
  6. 6. © HipByte SPRL
  7. 7. @atomicobject http://spin.atomicobject.com Garbage Collection (Sort of. Auto-release and retain, similar to ARC.)
  8. 8. (App idea shamelessly ripped off from HipByte.)
  9. 9. @atomicobject http://spin.atomicobject.com Ruby
  10. 10. Classes and methods; no header files; rest arguments. What you don’t see in the usual case is the flexibility of Ruby.
  11. 11. Method invocation syntax.
  12. 12. Keyword args: added to RubyMotion for Obj-C compatibility, now standard in Ruby 2.0.
  13. 13. do is syntax for blocks. Very similar to Objective C blocks parent= is just a method assumed to exist on el. Aliases to setParent if el is an Objective C object.
  14. 14. These features of ruby make it great for creating internal DSLs. Why create separate parsers for incomplete languages when your primary language is so flexible?
  15. 15. Unlike most languages, there are no contexts where you can’t put code. For example, within a class definition, you can do whatever you want.
  16. 16. For example, we could put a print statement in our class def.
  17. 17. This is how you’d normally write it.
  18. 18. Checking of valid objects in ActiveRecord validates is a method on class objects inheriting from ActiveRecord::Base
  19. 19. @atomicobject http://spin.atomicobject.com Rake
  20. 20. @atomicobject http://spin.atomicobject.com Specs
  21. 21. @atomicobject http://spin.atomicobject.com REPL
  22. 22. Now, if we hold command and click on an element, the context of our REPL changes to the clicked element. Right now our REPL says (main), meaning we haven’t clicked an element.
  23. 23. If we command-click our text-box, we see UILabel:0xf975. Now “self” refers to that element.
  24. 24. So we can set self.backgroundColor to see it change to red. Or we can tweak frame size to get the positioning just right.
  25. 25. @atomicobject http://spin.atomicobject.com What about Objective-C?
  26. 26. @atomicobject http://spin.atomicobject.com Apps
  27. 27. © 37signals
  28. 28. @atomicobject http://spin.atomicobject.com The End

×