2
votes

On Mac Catalyst my app feature with textfield becomeFirstResponder() doesn't work. I try to put this code in viewwillappear:

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    workoutExerciseNameTextField.becomeFirstResponder()

}

I also tried to use:

DispatchQueue.main.async{
        workoutExerciseNameTextField.becomeFirstResponder()
}

But this also doesn't work. Cell is twinkle for some time with selection and then twinkle out.

If I run my app in iOS it works as it should, but on Mac becomeFirstResponder() doesn't work.

How I can make textfields become firstresponder on Mac Catalyst versions of ios apps?

1
Is there any other code that deals with resigning first responder status anywhere in your view controller? - badhanganesh
I disabled all resignFirstResponder(), but anyway it doesn't work. - alexsmith
I think there is no concept of becomeFirstResponder - pushpank

1 Answers

0
votes

Are there any ListViews? In my app, they seem to become firstREsponder after a selection, and then don't let go. I force it to relinquish control in the didselect: method.