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
910
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
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
220
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
1.1k
Goで作る、開発・CI環境
sin392
0
190
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
0
540
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
610
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
110
PicoRuby on Rails
makicamel
2
120
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.2k
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
260
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
0
310
A2A プロトコルを試してみる
azukiazusa1
2
1.3k
Featured
See All Featured
Balancing Empowerment & Direction
lara
1
390
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
800
Code Reviewing Like a Champion
maltzj
524
40k
A Modern Web Designer's Workflow
chriscoyier
694
190k
4 Signs Your Business is Dying
shpigford
184
22k
Documentation Writing (for coders)
carmenintech
72
4.9k
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