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
BubbleWrap
Search
Marin Usalj
March 29, 2013
Programming
3
300
BubbleWrap
Slides for my talk at #inspect 2013 - the first RubyMotion conference in Bruselles.
Marin Usalj
March 29, 2013
Tweet
Share
More Decks by Marin Usalj
See All by Marin Usalj
Code signing on iOS/OSX
supermarin
2
440
Launch Arguments - the mysteries
supermarin
1
170
Swift for CLI tools
supermarin
15
25k
CocoaPods intro
supermarin
2
200
Private pods - best practices
supermarin
1
140
CLI apps. For fun and profit
supermarin
4
16k
Alcatraz internals
supermarin
2
240
ObjectiveSugar & ObjectiveRecord
supermarin
5
490
Alcatraz - Xcode package manager
supermarin
3
280
Other Decks in Programming
See All in Programming
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
390
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
540
労務ドメインを快適に開発する方法 / How to Comfortably Develop in the Labor Domain
yuki21
1
250
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
400
Swiftコードバトル必勝法
toshi0383
0
150
実践 Advanced CallKit 〜快適な通話の実現に向けて〜
mot_techtalk
3
120
GoのIteratorに詳しくなってしまう
inatonix
1
200
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
580
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
370
dRuby 入門者によるあなたの身近にあるdRuby 入門
makicamel
4
350
私のEbitengineの第一歩
qt_luigi
0
440
null or undefined
susisu
22
6.1k
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
Designing Experiences People Love
moore
138
23k
Into the Great Unknown - MozCon
thekraken
28
1.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
Statistics for Hackers
jakevdp
793
220k
Building Your Own Lightsaber
phodgson
101
6k
Fontdeck: Realign not Redesign
paulrobertlloyd
80
5.1k
Music & Morning Musume
bryan
46
6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
38
9.1k
Transcript
BubbleWrap Marin Usalj @mneorr Tuesday, April 2, 13
iOS consultant Ruby <3 Tuesday, April 2, 13
ObjectiveRecord ObjectiveSugar Kiwi Bubblewrap Tuesday, April 2, 13
[@3 times:^{ NSLog(@"Hello!"); }]; // Hello! // Hello! // Hello!
NSDate *future = @(24).days.fromNow; // 2012-12-25 20:49:05 +0000 NSDate *past = @(1).month.ago; // 2012-11-01 20:50:28 +00:00 NSString *sentence = NSStringWithFormat(@"This is a text-with- argument %@", @1234); [sentence split:@"-"] // array = this is a text, with, argument 1234 ObjectiveSugar github.com/mneorr/ObjectiveSugar Tuesday, April 2, 13
[cars each:^(id object) { NSLog(@"Car: %@", object); }]; // Car:
Testarossa // Car: F50 // Car: F458 Italia [cars map:^id(id car){ return @([[car substringToIndex:1] isEqualToString:@"F"]); }]; // NO (Testarossa) // YES (F50) // YES (F458 Italia) ObjectiveSugar github.com/mneorr/ObjectiveSugar Tuesday, April 2, 13
// creating [Person create:@{ @"name" : @"John", @"age" : @12
}]; Person *john = [Person create]; john.name = @"John"; // save/delete [john save]; [john delete]; // querying Person *johnDoe = [Person where:@"name == 'John' AND surname = 'Doe'"].first; NSArray *people = [Person where:@{ @"age" : @18 }]; ObjectiveRecord github.com/mneorr/ObjectiveRecord Tuesday, April 2, 13
“ActiveSupport for RubyMotion” Tuesday, April 2, 13
Tuesday, April 2, 13
Motivation Tuesday, April 2, 13
AFJSONRequestOperation.JSONOperationWithReuqest( NSURLRequest.requestWithURL( NSURL.URLWithString(‘http://mneorr.com’)), success: ? failure: ? ).start Tuesday, April
2, 13
AFJSONRequestOperation.JSONOperationWithReuqest( NSURLRequest.requestWithURL( NSURL.URLWithString(‘http://mneorr.com’)), success:^{ # handle good response } failure:^{
# handle bad response }).start Tuesday, April 2, 13
Tuesday, April 2, 13
AFJSONRequestOperation.JSONOperationWithReuqest( NSURLRequest.requestWithURL( NSURL.URLWithString(‘http://mneorr.com’)), success: lambda{|response| # handle good response }
failure: lambda{|response, error| # handle bad response }).start Tuesday, April 2, 13
Tuesday, April 2, 13
AFJSONRequestOperation.JSONOperationWithReuqest( NSURLRequest.requestWithURL( NSURL.URLWithString(‘http://mneorr.com’)), success: lambda{ |request, response, json| # handle
good response } failure: lambda{ |request, response, error, json| # handle bad response }).start Tuesday, April 2, 13
BW::HTTP Tuesday, April 2, 13
HTTP.get(‘http://mneorr.com’) do |response| if response.ok? # handle good response else
# handle failure end end Tuesday, April 2, 13
params = { foo: ‘bar’, baz: [:bang, :zsh] } HTTP.post(‘http://mneorr.com’,
payload: params) do |response| if response.ok? # handle good response else # handle failure end end Tuesday, April 2, 13
BW::Core Tuesday, April 2, 13
> Device.iphone? # true > Device.ipad? # false > Device.front_camera?
# true > Device.orientation # :portrait > Device.simulator? # true > Device.ios_version # "6.0" Tuesday, April 2, 13
JSON.parse("{\"foo\":1,\"bar\": [1,2,3],\"baz\":\"awesome\"}") => { foo: 1, bar: [1,2,3], baz: “awesome”
} JSON.generate({ foo: 1, bar: [1,2,3], baz: “awesome” }) => "{\"foo\":1,\"bar\":[1,2,3],\"baz\": \"awesome\"}" Tuesday, April 2, 13
BW.create_uuid => "68ED21DB-82E5-4A56-ABEB-73650C0DB701" '#FF8A19'.to_color => #<UIDeviceRGBColor:0x8d54110> App.open_url("http://mneorr.com") # Opens the
url using the device's browser. (accepts a string url or an instance of Tuesday, April 2, 13
Persistence Tuesday, April 2, 13
[Client]: hey, how hard is it to store some user
data? We may need to keep track of Foo and Bar! Tuesday, April 2, 13
Tuesday, April 2, 13
NSUserDefaults.standardUserDefaults .setValue(“Inspect”, forKey:”conference”) conf = NSUserDefaults.standardUserDefaults .valueForKey(“conference”) Tuesday, April 2,
13
Y U NO SAVE? Tuesday, April 2, 13
You didn’t #synchronize. Tuesday, April 2, 13
NSUserDefaults.standardUserDefaults .setValue(“Inspect”, forKey:”conference”) NSUserDefaults.standardUserDefaults .synchronize Tuesday, April 2, 13
include App Persistence[‘conference’] = “Inspect” conf = Persistence[‘conference’] Tuesday, April
2, 13
BW::Location Tuesday, April 2, 13
BW::Location.get do |result| result[:to].longitude result[:from].longitude end BW::Location.get_significant BW::Location.get_once Tuesday, April
2, 13
BW::UI Tuesday, April 2, 13
Tuesday, April 2, 13
view.when_swiped view.when_pressed view.when_panned view.when_pinched view.when_rotated view.when_tapped Tuesday, April 2, 13
@recognizer = view.when_swiped Tuesday, April 2, 13
BW::Media Tuesday, April 2, 13
@playa = BW::Media::Player.new @playa.play_modal(@local_file) Tuesday, April 2, 13
BW::Reactor (EventMachine) Tuesday, April 2, 13
“There is a ton of great stuff in BubbleWrap.” “If
you’re doing any RubyMotion work, I think you should definitely checkout BubbleWrap!” - the changelog Tuesday, April 2, 13
“To make our networking code painless, we’ll use BubbleWrap” -
smashingmagazine.com “Lots of good stuff in BubbleWrap” - Darrin Holst Tuesday, April 2, 13
“If there’s any one thing you can do after starting
a RubyMotion project, it’s immediately drop BubbleWrap into your repo.” - Nick, 37 Signals Tuesday, April 2, 13
github.com/rubymotion/bubblewrap bubblewrap.io Tuesday, April 2, 13
Questions Tuesday, April 2, 13
Thanks HipByte! Tuesday, April 2, 13