Where to call becomeFirstResponder(), at ViewDidAppear or ViewWillAppear?

Viewed 1035

What I want:

A textField and a textLabel is included in the tableView. When the tableView is present the textField will be the firstResponder and brings out the keyboard.

Problems I have:

the App is only shows the keyboard if the textField.becomeFirstResponder() is called within viewWillAppear or viewDidLoad (textField and textLabel is not showing at all).

How I fixed it:

The bug is not reproducible when I moved the textField.becomeFirstResponder() call into viewDidAppear

Question:

Am I spouse to call becomeFirstResponder() function inside the viewDidAppear function? otherwise the keyboard will block all the other views

Many Thanks

1 Answers
Related