O'Reilly logo

Swift OS X Programming for Absolute Beginners by Wallace Wang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required