Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputBarAccessoryView & inputTextView disappeared after searchbar has focused #252

Open
ismaelShabrawy opened this issue Oct 30, 2023 · 2 comments

Comments

@ismaelShabrawy
Copy link

ismaelShabrawy commented Oct 30, 2023

Dears,

Now the app have view controller has the tableview to show realtime chat message and we added InputBarAccessoryView and implement it and it working .

but we have a search bar when this search bar get focus and user type in the InputBarAccessoryView and the input text disappear from the screen and even in the debug view hierarchy
as the attached images:

before the search bar get focus the input text appears :
Screenshot 2023-10-30 at 12 54 14 PM

after the search bar focused and the user type :
Screenshot 2023-10-30 at 12 54 52 PM

so I need to show the InputBarAccessoryView again after the user finish searching

  • What version of InputBarAccessoryView are you using? 6.3.0
  • What version of iOS are you running on? 17.0.3
  • What version of Swift are you running on? 5.0
  • What device(s) are you testing on? Are these simulators? iPhone 12 Pro Max, no

I used this before focus searchbar

        self.messageInputBar.resignFirstResponder()
        self.messageInputBar.inputTextView.resignFirstResponder()

and this after the user end search or clicks the cancel button:

            self.messageInputBar.becomeFirstResponder()
            self.messageInputBar.inputTextView.becomeFirstResponder()

if let window = UIApplication.shared.delegate?.window {
                    window?.makeKey()
                    window?.becomeFirstResponder()
                }

and still not visible to the user

Thanks

@nathantannar4
Copy link
Owner

When using InputBarAccessoryView as an inputAccessoryView of a UIViewController, you should be making the view controller the first responder. It is expected that when it is not the first responder, the input bar is hidden.

https://developer.apple.com/documentation/uikit/uiresponder/1621119-inputaccessoryview

@gerchicov-vg
Copy link

Possibly my issue is similar:
#266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants