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
950
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CDEvents+ReactiveCocoa でファイル監視
Tomoki Aonuma
October 18, 2014
More Decks by Tomoki Aonuma
See All by Tomoki Aonuma
Git ライフを快適にする知られざるコマンドたち
uasi
48
10k
Other Decks in Programming
See All in Programming
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
460
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
210
Android CLI
fornewid
0
210
今さら聞けない .NET CLI
htkym
0
180
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
450
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
370
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
210
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
150
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
260
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
350
Built Our Own Background Agent at LayerX
layerx
PRO
9
5.1k
Featured
See All Featured
Design in an AI World
tapps
1
280
4 Signs Your Business is Dying
shpigford
187
22k
Ruling the World: When Life Gets Gamed
codingconduct
0
290
Designing for Timeless Needs
cassininazir
1
430
The Mindset for Success: Future Career Progression
greggifford
PRO
0
440
Facilitating Awesome Meetings
lara
57
7.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
570
New Earth Scene 8
popppiees
3
2.5k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Visualization
eitanlees
152
17k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
200
How to train your dragon (web standard)
notwaldorf
97
6.7k
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