If you need to take text input in your Swift app, you will probably need a UITextField. It is exactly what it sounds like, just a field on the screen where the user types something in. When the user taps on it, the keyboard comes up from the bottom of the screen, and allows the user to start typing. Then, usually, when the user clicks outside of the UITextField, the keyboard is dismissed, and the cursor is no longer in that UITextField.
However, a common issue for many iOS programming beginners is that the last part of that story isn’t built in. If you just plop on a UITextField, and try tapping somewhere else…. nothing happens. That’s what we’re here to fix today.