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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
130
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
240
OSもどきOS
arkw
0
590
act1-costs.pdf
sumedhbala
0
120
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.5k
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
360
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7k
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
110
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
1B+ /day規模のログを管理する技術
broadleaf
0
110
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Rails Girls Zürich Keynote
gr2m
96
14k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
210
Between Models and Reality
mayunak
4
350
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
How to make the Groovebox
asonas
2
2.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Being A Developer After 40
akosma
91
590k
Balancing Empowerment & Direction
lara
6
1.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
The Invisible Side of Design
smashingmag
301
52k
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