Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Use RubyMotion
Search
Brent Hargrave
April 10, 2013
Programming
68
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Use RubyMotion
Brent Hargrave
April 10, 2013
Other Decks in Programming
See All in Programming
Oxlintのカスタムルールの現況
syumai
6
1.2k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
300
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
120
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.8k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
180
スマートグラスで並列バイブコーディング
hyshu
0
260
OSもどきOS
arkw
0
590
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
360
act1-costs.pdf
sumedhbala
0
120
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
750
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
170
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
950
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Become a Pro
speakerdeck
PRO
31
6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Balancing Empowerment & Direction
lara
6
1.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
BBQ
matthewcrist
89
10k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
310
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Docker and Python
trallard
47
3.9k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
170
Transcript
Use RubyMotion Brent Hargrave @brenthargrave Lower Manhattan iOS Meetup April
10, 2013 Tuesday, May 21, 13
What is RubyMotion? Tuesday, May 21, 13
What is RubyMotion? Terminal-based toolchain for writing native iOS apps
in Ruby Tuesday, May 21, 13
Awesome... so what? Tuesday, May 21, 13
Awesome... so what? Write apps faster, with fewer bugs, than
in Xcode / Obj-C Tuesday, May 21, 13
How? Tuesday, May 21, 13
How? •Language: more expressive Tuesday, May 21, 13
How? •Language: more expressive •Configuration: not in Xcode Tuesday, May
21, 13
How? •Language: more expressive •Configuration: not in Xcode •Editor: is
not Xcode Tuesday, May 21, 13
How? •Language: more expressive •Configuration: not in Xcode •Editor: is
not Xcode •Testing: baked-in Tuesday, May 21, 13
Ruby •No header files! •No #import statements! •Terse syntax Tuesday,
May 21, 13
AFNetworking NSURLRequest *request = [NSURLRequest requestWithURL:url]; AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { // handle success } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { // handle failure }]; [operation start]; in Objective-C Tuesday, May 21, 13
AFNetworking request = NSURLRequest.requestWithURL url operation = AFJSONRequestOperation.JSONRequestOperationWithRequest request, success:
lambda { |request, response, id| # handle success }, failure: lambda { |request, response, error, id| # handle failure } operation.start straight Ruby port Tuesday, May 21, 13
AFNetworking AFMotion::Operation::JSON.get("request/path") do |result| if result.success? # handle success elsif
result.failure? # handle failure end end “authentic” Ruby port Tuesday, May 21, 13
Ugh, Ruby performance? •RubyMotion’s Ruby != MRI •Compiled, not interpreted
•Ruby => AST => LLVM IR => machine code Tuesday, May 21, 13
Ruby in Objective-C Runtime Tuesday, May 21, 13
Ruby inherits from Obj-C # kinda/sorta what's happening class String
< NSString #... end rb_string = "foo" rb_string.methods.include? "capitalizedString" #=> true Tuesday, May 21, 13
OK, so it’s fast. What about memory? Tuesday, May 21,
13
OK, so it’s fast. What about memory? ARC-like reference counting,
not garbage collected. Tuesday, May 21, 13
Configuration: Rake, not Xcode # -*- coding: utf-8 -*- $:.unshift("/Library/RubyMotion/lib")
require 'motion/project' Motion::Project::App.setup do |app| # Use `rake config' to see complete project settings. app.name = 'sample_app' end Tuesday, May 21, 13
Builds: Rake, not Xcode Tuesday, May 21, 13
Editor: [anything], not Xcode •Vim •Emacs •TextMate •Notepad? Tuesday, May
21, 13
Editor: [anything], not Xcode •Eliminates faux vs. *actual* source structure
conflicts Tuesday, May 21, 13
Xcode is dead, long live Xcode! Tuesday, May 21, 13
RubyMotion & Xcode •Xcode artifacts can be used in RM
•Storyboards •CoreData models Tuesday, May 21, 13
RubyMotion & Xcode Motion::Project::App.setup do |app| # ... app.pods do
pod "RestKit" pod "AFNetworking" end end Tuesday, May 21, 13
RubyMotion & Xcode •Obj-C inside RM •RM in Xcode/Obj-C Tuesday,
May 21, 13
But... Tuesday, May 21, 13
Apple.can_ban? RubyMotion #=> true Tuesday, May 21, 13
RubyMotion.profiler.exists? #=> false Tuesday, May 21, 13
RubyMotion.open_source? #=> false Tuesday, May 21, 13
RubyGems •Share RM code using gems •But few existing gems
work! •No “eval” or “require” Tuesday, May 21, 13
Smug Hipsters Tuesday, May 21, 13
Keep an eye on it. Tuesday, May 21, 13
Next great mobile startup? Tuesday, May 21, 13
Next great iOS library? Tuesday, May 21, 13
Questions? Tuesday, May 21, 13
Questions? •@brenthargrave •http://brent.is •github.com/jamescallmebrent Tuesday, May 21, 13