© Wallace Wang 2017

Wallace Wang, macOS Programming for Absolute Beginners, 10.1007/978-1-4842-2662-9_19

19. Using Text with Labels, Text Fields, and Combo Boxes

Wallace Wang

(1)San Diego, California, USA

When a program needs to 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 numbers, unusual characters, or ordinary letters. This means a program may need to verify that the user typed ...

Get macOS Programming for Absolute Beginners: Developing Apps Using Swift and Xcode now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.