In SlackTextViewController, if I present a UIAlertController, the text input view doesn't show properly

55 views Asked by At

I had an issue when using SlackTextViewController where based on tapping a chat item, I presented a UIAlertController. When I dismissed the UIAlertController, the text input control didn't reappear; the keyboard showed back up, but it covered the text input control. I had to manually dismiss the keyboard and show it again.

How do I get it to not cover the text input control when the keyboard reappears?

1

There are 1 answers

0
Anthony Mills On BEST ANSWER

SlackTextViewController has a method of dealing with this, but it's not documented well. When the notification comes in to show the keyboard, the first responder is the UIAlertController so it basically ignores it. There's a function that controls whether to override this behavior:

- (BOOL)forceTextInputbarAdjustmentForResponder:(UIResponder *)responder
{
    return NO;
}

Basically in your subclass override this to be something that returns true if responder is a UIAlertController.