Hardware –> Keyboard –> Connect Hardware Keyboard
and make sure it is turned OFF (no check mark).
Hardware Keyboard means the big keyboard on your computer.No Hardware Keyboard means use the little keyboard that pops up on the phone.
The Hardware Keyboard is good for testing that your app can read the contents of the text field. But you also need to test the UI (user interface) to make sure that it allows the user to do everything they want.
This video demonstrates the problem: https://youtu.be/TQjzu8y1F_s
You can use code like this to help fix it:
class WordsViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. let tap: UITapGestureRecognizer = UITapGestureRecognizer( target: self, action: "dismissKeyboard") view.addGestureRecognizer(tap) } @objc func dismissKeyboard() { // Causes the view (or one of its embedded text fields) // to resign the first responder status. view.endEditing(true) } }
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.