I have a UITextView, and I'd like to show UILabel once it receives First Responder status, and hide UILabel when UITextView loses it.
What action handles becoming/losing first responder? Or perhaps there is a better way to display UILabel only when UITextView has focus?
UIView is a subclass of UIResponder. Your view will be sent a -(BOOL)becomeFirstResponder when it becomes first responder and -(BOOL)resignFirstResponder when it loses it. You can also perform some processing before both of these events from –(BOOL)canBecomeFirstResponder and –(BOOL)canResignFirstResponder. All of these methods are defined on UIResponder.
In all cases, assuming you do want to become (or resign) first responder, you should return YES to these messages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With