InputBarAccessoryView
InputBarAccessoryView copied to clipboard
iOS 14.2: rejected resignFirstResponder when being removed from hierarchy
Example[44229:872073] [View] First responder warning: '<InputBarAccessoryView.InputTextView: 0x7fb27d02ca00; baseClass = UITextView; frame = (0 0; 291 38); text = ''; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x6000013b6b80>; layer = <CALayer: 0x600001d96e40>; contentOffset: {0, 0}; contentSize: {142.5, 36.5}; adjustedContentInset: {0, 0, 0, 0}>' rejected resignFirstResponder when being removed from hierarchy
To Reproduce
- Open the Example app and pick any example in the InputAccessoryView section
- Tap into textfield
- Slide it down to end editing
Expected behavior
resignFirstResponder and hence keyboardManager.on(event: .willHide)
should get called
(it's getting called in Simulator but not on a real device (tried it with iPhone 11 pro)
I think it's a bug in iOS 14.2 https://openradar.appspot.com/FB8832021
Environment 5.2.2 - Example app
Yep, same here. If I call resignFirstResponder() in viewWillDisappear() the willHide notification gets fired as intended. When resignFirstResponder() called in other methods the notification does not work. Have tested in both 14.2 and 14.3
Thank for letting us know it's probably an iOS thing!
Any workarounds? @Kaspik @mschonvogel @acydapp
Any workarounds? @Kaspik @mschonvogel @acydapp
Got this solution from @mschonvogel and it works for my case: try textview's didEndEditing method
@acydapp hi, can u explain more, thanks
This is not an issue anymore, is it @mschonvogel ?