Upload
clay-allsopp
View
2.585
Download
1
Tags:
Embed Size (px)
Citation preview
the future of RubyMotion
@clayallsopp
- http://rubymotion-tutorial.com
- http://github.com/clayallsopp/
- Formotion, Routable, and more
- http://bubblewrap.io
- Upcoming RubyMotion PragProgs book
Where are we now?May 2012 - Sept 2012
- Production, award-winning apps shipping
- New RM features and bugfixes weekly-ish
- Awesome, active community
Where are we going?→ Community will make or break RM
1:1 ObjC → RubyWave 1
BubbleWrap# NSSearchPathForDirectoriesInDomains...App.documents_path
# NSBundle.mainBundle.resourcePathApp.resources_path
# NSNotificationCenter.defaultCenterApp.notification_center
Wrapping ObjCWave 2
BubbleWrap
BW::Location.get do |result| p "From Lat #{result[:from].latitude}, Long #{result[:from].longitude}" p "To Lat #{result[:to].latitude}, Long #{result[:to].longitude}"end
Twittermotion
Twitter::Composer.compose(tweet: 'Hello RubyMotion!', urls: ["http://clayallsopp.com"]) do |composer| if composer.error # ... elsif composer.cancelled? # ... elsif composer.done? # ... endend
New MetaphorsWave 3
Teacup
Teacup::Stylesheet.new(:some_view) do style :root, landscape: true
style :field, left: 10, top: 10, width: 200, height: 50, landscape: { width: 360 }
style :search, extends: :field, left: 10, top: 70, placeholder: 'Find something...'
style UITextField, textColor: UIColor.redColorend
class SomeController < UIViewController stylesheet :some_view
layout :root do subview(UITextField, :field) @search = subview(UITextField, :search) endend
New MetaphorsWave 3
Formotion
class User include Formotion::Formable
form_property :name, :string form_property :score, :number
form_property :team, :picker, items: ["Red", "Blue", "Green"]
form_title "Edit User"end
# ...
user = User.new("Harry", 100, "Green")controller = Formotion::FormableController.alloc.initWithModel(user)self.navigationController << controller
New MetaphorsWave 3
Nitron
class Task < Nitron::Model def self.all order("due") endend
class TaskListViewController < Nitron::TableViewController collection { Task.all }end
New MetaphorsWave 3
[YOUR LIBRARY HERE]
The Killer Framework
- API-driven apps are dead simple
- UI scaffolding based on models
- Completely abstracts the UIKit/Cocoa
Sources
• https://github.com/rubymotion/bubblewrap
• https://github.com/clayallsopp/twittermotion
• https://github.com/rubymotion/teacup
• https://github.com/clayallsopp/formotion
• https://github.com/mattgreen/nitron
• Also: http://rubymotion-wrappers.com