Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build an Interactive Story App with Swift Adding Sound Effects Repositioning the Text Field

Keyboard will not show

With keyboardWillShow, the keyboard appeared but covered the text field box. After entering keyboardWillHide code, the keyboard does not appear at all anymore.

2 Answers

I'm not sure if this will help, but sometimes the simulator's default is to not show the keyboard. You can toggle the setting with shortcut cmd+K.

Things to Check:

  1. Did your keyboard only show when you click the text field? (It's only supposed to show when you click in the text field. It doesn't show right away when you run/load the app.)
  2. Does your keyboard hide when you hit enter on your computer keyboard or click "return" on the simulator keyboard? (It's only supposed to hide when you do either of those 2 actions.)

If your keyboard still doesn't show, then I'm not sure why.