Last active
August 29, 2015 14:21
-
-
Save tonyarnold/fd587cad039a8cc30845 to your computer and use it in GitHub Desktop.
Detects when a text field's current editor is the parent window's first responder (the "view" here is an NSTableCellView subclass)
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 *textFieldDidFocus = [[[[view rac_valuesForKeyPath:@keypath(view, textField.window.firstResponder) observer:view] | |
takeUntil:view.rac_willDeallocSignal] filter:^BOOL(id value) { | |
@strongify(view); | |
return [view.textField.currentEditor isEqualTo:value]; | |
}] | |
mapReplace:view.textField]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment