I have custom UIToolbar
's that sit ontop of my keyboard when it displays and that I use to insert pre-formatted text. My problem is that I have one UITextView
and two UITextField
's that are potential users of my pre-formatted text.
When the buttons call an IBAction
, how can I tell which element has focus and is the firstResponder
?
Attempt #2 at asking my question smartly:
I need to call [textElement selectedRange];
on the UITextField
or UITextView
that has focus. How can I declare textElement
in a way that it doesn't matter which of the view UIText*
classes it is?
If I do the following...
UIView *textElement = [self my_method_of_getting_first_responder];
NSRange range = [textElement selectedRange];
I of course get the
UIView does not declare selector 'selectedRange'
Thanks!