Exception raised when I use becomeFirstResponder.

Hello


I have a code that it's workin on ios 12 and on Simulator with ios 13 beta

The code crash on physical device iPhone 7 with ios13 beta with this error


Attempted to access the table view visible Cells while they were in the process of being updated, which is not allowed.


If in the viewDidLoad method I remove the becomeFirstResponder call, the application works correctly.


Is it a bug in iOS 13 beta ?

Replies

Additional information to reproduce the bug


Declare an UITableVieewController, the TableView must be configured in static mode, with 3 sections. For each section declare only one cell.

For each UITableViewCell in the containing View I add a UITextField. So you have now 3 UITextField for each cell attached to an IBOutlet in the code


In the ViewDidLoad for the controller call becomeFirstResponder on one of the UITextField. on Simulator or iOS 12 this code is working. On ios 13 beta it crashes only on physical device.

Were you able to figure this out? I just started testing on iOS 13 and noticed that my app crashes when I try to make my text field become the first responder.

I figured out the issue. Since there were a lot of things deprecated in the latest iOS update, I forgot to take out my keyboard code that was deprecated. I was using this before:



let keyboardHeight = (notification[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgSizeValue.height



Now I am using the following:



let keyboardSize = (notification[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue



Hope this helps anyone in the future.

Yup, I have same issue in iOS 13. but App also crash when we type UISearchBar or make it becomeFirstResponder.


If any have solution Please let me know