@@ -57,7 +57,7 @@ static dispatch_queue_t BKObserverMutationQueue() {
57
57
static dispatch_queue_t queue = nil ;
58
58
static dispatch_once_t token = 0 ;
59
59
dispatch_once (&token, ^{
60
- queue = dispatch_queue_create (" org. blockskit.observers.queue " , 0 );
60
+ queue = dispatch_queue_create (" us.pandamonia. blockskit.observers" , 0 );
61
61
});
62
62
return queue;
63
63
}
@@ -84,11 +84,7 @@ - (NSString *)addObserverForKeyPaths:(NSArray *)keyPaths options:(NSKeyValueObse
84
84
return token;
85
85
}
86
86
87
- - (void )addObserverForKeyPath : (NSString *)keyPath identifier : (NSString *)identifier options : (NSKeyValueObservingOptions )options task : (BKObservationBlock)task {
88
- [self addObserverForKeyPaths: @[keyPath] identifier: identifier options: options task: (id )task];
89
- }
90
-
91
- - (void )addObserverForKeyPaths : (NSArray *)keyPaths identifier : (NSString *)identifier options : (NSKeyValueObservingOptions )options task : (BKMultipleObservationBlock)task {
87
+ - (void )bk_addObserverForKeyPaths : (NSArray *)keyPaths identifier : (NSString *)identifier options : (NSKeyValueObservingOptions )options context : (void *)context task : (id )task {
92
88
NSParameterAssert (keyPaths.count);
93
89
NSParameterAssert (identifier.length);
94
90
NSParameterAssert (task);
@@ -109,12 +105,21 @@ - (void)addObserverForKeyPaths:(NSArray *)keyPaths identifier:(NSString *)identi
109
105
}];
110
106
});
111
107
112
- void *context = (options == 0 ) ? ((keyPaths.count == 1 ) ? &kBlockObservationNoChangeContext : &kMultipleBlockObservationNoChangeContext ) : ((keyPaths.count == 1 ) ? &kBlockObservationContext : &kMultipleBlockObservationContext );
113
108
[keyPaths each: ^(NSString *keyPath) {
114
109
[self addObserver: newObserver forKeyPath: keyPath options: options context: context];
115
110
}];
116
111
}
117
112
113
+ - (void )addObserverForKeyPath : (NSString *)keyPath identifier : (NSString *)identifier options : (NSKeyValueObservingOptions )options task : (BKObservationBlock)task {
114
+ void *context = (options == 0 ) ? &kBlockObservationNoChangeContext : &kBlockObservationContext ;
115
+ [self bk_addObserverForKeyPaths: @[keyPath] identifier: identifier options: options context: context task: task];
116
+ }
117
+
118
+ - (void )addObserverForKeyPaths : (NSArray *)keyPaths identifier : (NSString *)identifier options : (NSKeyValueObservingOptions )options task : (BKMultipleObservationBlock)task {
119
+ void *context = (options == 0 ) ? &kMultipleBlockObservationNoChangeContext : &kMultipleBlockObservationContext ;
120
+ [self bk_addObserverForKeyPaths: keyPaths identifier: identifier options: options context: context task: task];
121
+ }
122
+
118
123
- (void )removeObserverForKeyPath : (NSString *)keyPath identifier : (NSString *)identifier {
119
124
NSParameterAssert (keyPath.length);
120
125
NSParameterAssert (identifier.length);
0 commit comments