0

When I touch my textfields in the iPhone simulator, the keyboard cursor does not appear. I do not know why. These are the only functions related to my keyboard in my view controller.

 // hides keyboard when user touches outside of text field override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { self.view.endEditing(true) } // hides keyboard when user presses 'return' func textFieldShouldReturn(textField: UITextField) -> Bool { if (textField === emailField) { emailField.resignFirstResponder() } else if (textField === usernameField) { usernameField.resignFirstResponder() } else { passwordField.resignFirstResponder() } return true } 

2 Answers 2

1

Try changing the tintColor property of your UITextField (for example, to the default UIColor.blueColor).

Sign up to request clarification or add additional context in comments.

4 Comments

The hardware keyboard isn't active. The simulator keyboard pops up and works fine. I can type anything in the textfield. It's just that the cursor is invisible.
Oh sorry, I misread your question. Is the cursor visible when running on a device?
If not, try setting the tintColor of your UITextField to the default (UIColor.blueColor).
I changed my tintColor and the cursor appears. Thanks!
0

Maybe the keyboard in your iPhone simulator is toggled off.

Try clicking,

Hardware > Keyboard > Toggle Software Keyboard

Else on mac you can press Command K

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.