- [Download Xcode 8.2.1 project with full Swift 3 source from GitHub.]
- [Download Xcode 8.2.1 playground with full Swift 3 source from GitHub.]
How would you enable or disable multiple user interface controls using one IBOutlet and one IBAction? For example, you might need to disable a UITextBox and UISegmentedControl because a user’s login has expired. Perhaps a user hasn’t filled in some required fields on a form, so you want to disable several buttons. Watch the following video to see how I built a Swift 3 app to use a UISwitch to enable or disable four controls all at one time — and I demonstrated the object-oriented programming (OOP) principle of polymorphism:
Refresh your memory about OOP and inheritance.