Introduction to RubyMotion
The Cool Way to Build iOS Apps
ByGantLaborde
@GantLaborde
Avid Rubyistand generallyimmature guy
Co-Founder of IconoclastLabs.com
Author of Numerous RubyMotion projects and PullRequests
Author of the book RubyMotion App Development
byPacktPublishing.
Motion Meetup Organizer
RubyMotion's MonthlyMeetup
meetup.RubyMotion.com
Matt Garrison
@mattsgarrison
RubyMotion
RubyMotion - Wat?
/ˈro ͞obē-mōSHən/
noun trademark
1. Aproprietarytoolchain, created byHipByte SPRL, for
developingnative ...
Quick Example
Objective-C button tap
[button addTarget:self action:@selector(buttonTapped:)
forControlEvents: UIControlEve...
Better Example
Objective-C button tap
[button addTarget:self action:@selector(buttonTapped:)
forControlEvents: UIControlEv...
and more like_ruby
lessLike:objectiveC:
-ClayAllsopp
What's So Great About RubyMotion?
In my opinion
Gems and Community
Editor Independence
Testing!
Readability
NativelyCompil...
RubyMotion Analogy
RubyMotion is to Objective-C
As Coffeescriptis to Javascript
... plus gems are kind of like jQueryplugi...
Let's Look At Code!
Classic -Hello World
FullApp -RubyTrivia
Games!
Hello World
$ motion create test
Tests willfail
class AppDelegate
def application(application, didFinishLaunchingWithOptio...
Hello World - REPL
main_view = UIApplication.sharedApplication.windows[0].rootViewController.view
main_view.backgroundColo...
Code Example #2
Ruby Trivia
sugarcube
Teacup
ProMotion
BubbleWrap
formotion
and more ...
iconoclastlabs.github.io/rubytrivia/
Availableonitunes
Let's look at the code!
Code Example #3
Joybox
Joybox
joybox.io
Based on Cocos2D
Includes Box2D physics
Wrapped in RubyAPI
EASY
Joybox
Let's look at some Joybox code!
2:51
Totally Tacos!
Agame made in one day!
Thank you!
Questions?
@GantLaborde
Feelfree to contactme viaGant@IconoclastLabs.com
Upcoming SlideShare
Loading in …5
×

Introduction to RubyMotion - The Cool Way to Build iOS Apps

412 views
367 views

Published on

Introduction to RubyMotion by Gant Laborde - 2013
Live Presentation Link - http://gantman.github.io/RubyMotion-Intro/
Presentation Code - https://github.com/GantMan/RubyMotion-Intro

Published in: Technology, Education
1 Comment
1 Like
Statistics
Notes
  • nice one
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
412
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Introduction to RubyMotion - The Cool Way to Build iOS Apps

  1. 1. Introduction to RubyMotion The Cool Way to Build iOS Apps ByGantLaborde
  2. 2. @GantLaborde Avid Rubyistand generallyimmature guy Co-Founder of IconoclastLabs.com
  3. 3. Author of Numerous RubyMotion projects and PullRequests Author of the book RubyMotion App Development byPacktPublishing.
  4. 4. Motion Meetup Organizer RubyMotion's MonthlyMeetup meetup.RubyMotion.com
  5. 5. Matt Garrison @mattsgarrison
  6. 6. RubyMotion
  7. 7. RubyMotion - Wat? /ˈro ͞obē-mōSHən/ noun trademark 1. Aproprietarytoolchain, created byHipByte SPRL, for developingnative iOS and OS X applications on Apple devices and computers bystaticallycompilingthe Rubyprogramming language. OR Apps the Ruby Way
  8. 8. Quick Example Objective-C button tap [button addTarget:self action:@selector(buttonTapped:) forControlEvents: UIControlEventTouchUpInside]; // Elsewhere - (void)buttonTapped:(id)sender { self.view.backgroundColor = [UIColor redColor]; } RubyMotion button tap button.addTarget(self, action:'button_tapped', forControlEvents:UIControlEventTouchUpInside) # Elsewhere def button_tapped self.view.backgroundColor = UIColor.redColor end
  9. 9. Better Example Objective-C button tap [button addTarget:self action:@selector(buttonTapped:) forControlEvents: UIControlEventTouchUpInside]; // Elsewhere - (void)buttonTapped:(id)sender { self.view.backgroundColor = [UIColor redColor]; } RubyMotion button tap (withsugarcubegem) button.on(:touch) do self.view.backgroundColor = :red.uicolor end
  10. 10. and more like_ruby lessLike:objectiveC: -ClayAllsopp
  11. 11. What's So Great About RubyMotion? In my opinion Gems and Community Editor Independence Testing! Readability NativelyCompiled The REPL
  12. 12. RubyMotion Analogy RubyMotion is to Objective-C As Coffeescriptis to Javascript ... plus gems are kind of like jQueryplugins ... plus MacBacon has spec tests like Jasmine would ... plus the REPL lets you live-modifylike developer tools ... plus itcompiles and obfuscates your finalcodebase ... OK, this analogygotoutof control
  13. 13. Let's Look At Code! Classic -Hello World FullApp -RubyTrivia Games!
  14. 14. Hello World $ motion create test Tests willfail class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) @window.rootViewController = HelloWorldController.new @window.makeKeyAndVisible true end end class HelloWorldController < UIViewController def viewDidLoad p "Hai" end end Now tests pass!
  15. 15. Hello World - REPL main_view = UIApplication.sharedApplication.windows[0].rootViewController.view main_view.backgroundColor = UIColor.blueColor OR, justcommand click the view! # REPL input self.backgroundColor = UIColor.whiteColor @label = UILabel.new @label.text = "Hello World" @label.sizeToFit self.addSubview(@label) # get down from there! @label.center = [100, 100] OR, use sugarcube-repl's tree command.
  16. 16. Code Example #2 Ruby Trivia sugarcube Teacup ProMotion BubbleWrap formotion and more ...
  17. 17. iconoclastlabs.github.io/rubytrivia/
  18. 18. Availableonitunes
  19. 19. Let's look at the code!
  20. 20. Code Example #3 Joybox
  21. 21. Joybox joybox.io Based on Cocos2D Includes Box2D physics Wrapped in RubyAPI EASY
  22. 22. Joybox
  23. 23. Let's look at some Joybox code! 2:51
  24. 24. Totally Tacos! Agame made in one day!
  25. 25. Thank you! Questions? @GantLaborde Feelfree to contactme viaGant@IconoclastLabs.com

×