Chapter    17

Using Text with Labels, Text Fields, and Combo Boxes

When a program can offer a limited range of valid options to the user, that’s when you want to use check boxes, radio buttons, date pickers, or sliders. However, sometimes a program needs to allow the user to type in data that can never be predicted ahead of time, such as a person’s name. When a program needs to allow the user to type in data, that’s when you need to use a text field or a combo box.

A text field lets the user type in anything he or she wants including numbers, unusual characters, or ordinary letters. That means a program needs to verify that the user typed in valid data.

Sometimes a program can offer the user both the option of choosing from a limited selection ...

Get Swift OS X Programming for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.