How can I force my keyboard to be up on my program's start in Swift?

前端 未结 1 463
花落未央
花落未央 2020-12-07 04:02

I want the keyboard to go up as the app is starting and starting typing into the text field that I have.

相关标签:
1条回答
  • 2020-12-07 04:28

    In your viewDidAppear method, add the following:

    txtField1.becomeFirstResponder()
    

    For more information about UIResponder's becomeFirstResponder(), check the documentation.

    0 讨论(0)
提交回复
热议问题