Last active
August 29, 2015 14:04
-
-
Save atsusy/c724dffec96b95324c2f to your computer and use it in GitHub Desktop.
Array insertion/deletion signal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RACSignal *s = [self rac_valuesAndChangesForKeyPath:@keypath(self, mutableArray) | |
options:NSKeyValueObservingOptionNew| | |
NSKeyValueObservingOptionOld | |
observer:nil]; | |
[s subscribeNext:^(RACTuple *x){ | |
NSLog(@"x:%@", x); | |
}]; | |
self.mutableArray = [NSMutableArray new]; | |
NSMutableArray *proxyArray = [self mutableArrayValueForKey:@keypath(self, mutableArray)]; | |
[proxyArray addObject:@"1"]; | |
[proxyArray addObject:@"2"]; | |
[proxyArray addObject:@"3"]; | |
[proxyArray addObject:@"4"]; | |
[proxyArray removeLastObject]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment