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
CDEvents+ReactiveCocoa でファイル監視
Search
Tomoki Aonuma
October 18, 2014
Programming
1
890
CDEvents+ReactiveCocoa でファイル監視
Tomoki Aonuma
October 18, 2014
Tweet
Share
More Decks by Tomoki Aonuma
See All by Tomoki Aonuma
Git ライフを快適にする知られざるコマンドたち
uasi
48
10k
Other Decks in Programming
See All in Programming
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
240
私のEbitengineの第一歩
qt_luigi
0
440
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
190
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
110
実践!難読化ガイド
mitchan
0
120
unique パッケージから学ぶ interning と weak reference @ Asakusa.go#3
karamaru
2
740
Architecture Decision Record (ADR)
nearme_tech
PRO
1
670
What we keep in mind when migrating from Serverless Framework to AWS CDK and AWS SAM
kasacchiful
1
140
Jakarta EE meets AI
ivargrimstad
1
360
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
400
Swift Concurrencyとレースコンディション
objectiveaudio
1
410
実践 Advanced CallKit 〜快適な通話の実現に向けて〜
mot_techtalk
3
120
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
508
110k
What's in a price? How to price your products and services
michaelherold
242
11k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
Making Projects Easy
brettharned
113
5.8k
YesSQL, Process and Tooling at Scale
rocio
167
14k
It's Worth the Effort
3n
182
27k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
47
48k
Why Our Code Smells
bkeepers
PRO
334
56k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Transcript
$%&WFOUT 3FBDUJWF$PDPB ͰϑΝΠϧࢹ 3FBDUJWF$PDPB5PLZP !VBTJ
ࣗݾհ!VBTJ *ODSFNFOUTגࣜձࣾ ੨পथ
w,PCJUPͰϑΝΠϧࢹ wΧελϜ$44 w%#ಉظ
'4&WFOUT"1*
FSEventStreamRef FSEventStreamCreate( CFAllocatorRef allocator, FSEventStreamCallback callback, FSEventStreamContext *context, CFArrayRef pathsToWatch,
FSEventStreamEventId sinceWhen, CFTimeInterval latency, FSEventStreamCreateFlags flags); $"1* UPPMPXMFWFM
$%&WFOUT /rastersize/CDEvents
self.events = [[CDEvents alloc] initWithURLs:URLs block:^(CDEvents *watcher, CDEvent *event) {
doSomething(); }];
$%&WFOUT 3"$&YUFOTJPOT git.io/-G5IKg
self.signal = [CDEvents rac_signalForEventsWithURLs: URLs]; [self.signal subscribeNext:^(RACTuple *t) { RACTupleUnpack(
CDEvents *watcher, CDEvent *event) = t; doSomething(); }];
self.events = [[CDEvents alloc] initWithURLs:URLs block:^(CDEvents *watcher, CDEvent *event) {
doSomething(); }]; ʢ࠶ܝʣ
w͘ͳͬͯΔ͚Ͳʜ wpMUFS wUISPUUMF w͑ͯศརʂʂʂ
+ rac_signalFor... { ... objc_setAssociatedObject( signal, // ←γάφϧ͕ _cmd, watcher,
// ←͍ͭ͜Λอ࣋ OBJC_ASSOCIATION_RETAIN); $%&WFOUTͷ Πϯελϯεʁ
MJCFYUPCKDͷ /jspahrsummers/libextobjc
!XFBLJGZ !TUSPOHJGZ
- (void)foo { @weakify(self); self.prop = ^{ @strongify(self); self =
...; } }
!PO&YJU\^
- (void)foo { @onExit { NSLog(@"3"); }; { @onExit {
NSLog(@"1"); }; } NSLog(@"2"); }
!DPODSFUFQSPUPDPM
@protocol NoDragDrop <NSObject>; @concrete - (NSUInteger)webView:...; @end ! @concreteprotocol(NoDragDrop) -
(NSUInteger)webView:... {...} @end ! @interface MyViewController () <NoDragDrop>; @end
Ά͍ͷΛ࡞ͬͨ
!PO%FBMMPD\^ !PO%FBMMPD0G0CKFDU \^ git.io/Yuip2Q
- (void)foo { @onDealloc { doSomething(); }; @onDeallocOfObject(bar) { doSomething();
}; }
- (void)foo { @onDealloc { doSomething(); }; }
- (void)foo { RACDisposable *disposable = [RACObserve()...]; @onDealloc { [disposable
dispose]; }; }
5IBOLZPV