iOS 16.4: UISearchTextField.resignFirstResponder() --> app hangs, CPU 100%

Since iOS 16.4, my apps hangs when I dismiss the keyboard in viewWillDisappear(). Here is my code:

override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    DLog("will disappear <<<<<")
    dismissKeyboard()
}

fileprivate func dismissKeyboard() {
    self.filenameSearchTextField.resignFirstResponder()
}

App hangs, CPU is 100%, memory usage is increasing. The hangs happen on the resignFirstResponder() call.

What's going on here?

  • You can try checking to see if the control is still the first responder before resigning it also remove the DLog as well and see what happens.

Add a Comment