Skip to content

Instantly share code, notes, and snippets.

@rizumita
Created December 15, 2013 21:59
Show Gist options
  • Save rizumita/7978754 to your computer and use it in GitHub Desktop.
Save rizumita/7978754 to your computer and use it in GitHub Desktop.
ReactiveCocoaでKVOの新旧の値を受け取る
[[object rac_valuesAndChangesForKeyPath:@keypath(object, keypath) options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld observer:nil] subscribeNext:^(RACTuple *tuple) {
NSDictionary *changeDictionary = tuple.second;
if (![changeDictionary[@"new"] isEqualToNumber:changeDictionary[@"old"]]) {
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment