How To Enable Text Input In Swift UITextField & UITextView When Run App In iOS Simulator

In my iOS app, i add a UITextField in the Main.storyboard file. When i run the app in iOS simulator, i find i can not input text in the UITextField use my Mac book pro hardware keyboard. And i find the soft keyboard do not prompt in the iOS simulator when i focus on the input text box. Below is the method to fix this issue.

1. How To Enable Text Input Use Mac Book Pro Physical Keyboard In iOS Simulator.

  1. Focus on the iOS simulator and the UITextField object.
  2. Click Hardware —> Keyboard —> Connect Hardware Keyboard menu item at Simulator top menu bar. You should make sure the Connect Hardware Keyboard sub menu item be checked.
    hardware ---> keyboard ---> connect hardware keyboard
  3. Now you can click the UITextField input text box to input text.

2. How To Fix Can Not Prompt Soft Keyboard In iOS Simulator.

  1. If you want to prompt the iOS simulator soft keyboard to input text.
  2. You should first check theĀ Hardware —> Keyboard —> Connect Hardware Keyboard menu item.
  3. Then click the Hardware —> Keyboard —> Toggle Software Keyboard menu item. Then you can see the soft keyboard popup in the iOS simulator.
READ :   How To Set iOS UIView Background With Customized Color Or Image In Swift

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.