Closed brod-ie closed 6 years ago
Remember for an InputAccessoryView to be visible it's the ViewController itself that should be the first responder. Make sure canBecomeFirstResponder
is overridden to true. Then by default the bar will be there when the ViewController is displayed. Also I don't think iOS will allow something to be the first responder when it's not visible which is why it has no effect. Is that what you mean by become available?
Sent with GitHawk
Yes we've tried putting becomeFirstResponder()
early on too with no luck. Indeed canBecomeFirstResponder
is overridden.
From this SO answer I've learnt to achieve this DispatchQueue.main.async
needs to be used.
What are you trying to do? Have the keyboard raise when the user enters chat?
Sent with GitHawk
We've found
self.bar.inputTextView.becomeFirstResponder()
has to be called in or afterviewDidAppear
. Placing this call earlier in the view's lifecycle has no effect. We've also tried callingbecomeFirstResponder()
then this call to no avail.We'd like the input text view to be focussed without animation immediately (akin to Messenger). How can we go about this?