Contents
Chapter 1: Understanding Programming
Understanding Programming Languages
The View-Model-Controller Design
Chapter 2: Getting to Know Xcode
Creating and Customizing a User Interface
The Standard and Assistant Editors
Chapter 3: The Basics of Creating a Mac Program
Using the Document Outline and Connections Inspector
Understanding the Cocoa Framework
Looking Up Properties and Methods in a Class File
Looking Up Class Files with the Help Menu
Looking Up Class Files with Quick Help
Understanding How OS X Programs Work
Using Unicode Characters as Names
Linking Swift Code to a User Interface
Chapter 6: Manipulating Numbers and Strings
Simple Functions Without Parameters or Return Values
Simple Functions With Parameters
Functions With Parameters That Return Values
Defining External Parameter Names
Understanding IBAction Methods
Chapter 7: Making Decisions with Branches
Understanding Comparison Operators
Understanding Logical Operators
Using the switch Statement with enum Data Structures
Making Decisions in an OS X Program
Chapter 8: Repeating Code with Loops
Using Loops in an OS X Program
Chapter 9: Arrays and Dictionaries
Retrieving and Updating Data in a Dictionary
Using Dictionaries in an OS X Program
Chapter 10: Tuples, Sets, and Structures
Adding and Removing Items from a Set
Storing and Retrieving Items from a Structure
Using Structures in an OS X Program
Chapter 11: Creating Classes and Objects
Accessing Properties in an Object
Computed Properties in an Object
Using Objects in an OS X Program
Chapter 12: Inheritance, Polymorphism, and Extending Classes
Defining Optional Methods and Properties in Protocols
Using Inheritance with Protocols
Using Inheritance in an OS X Program
Chapter 13: Creating a User Interface
Understanding User Interface Files
User Interface Items That Display and Accept Text
User Interface Items That Restrict Choices
User Interface Items That Accept Commands
User Interface Items That Groups Items
Using Constraints in Auto Layout
Placing Constraints on User Interface Items
Defining Constraints in an OS X Program
Chapter 14: Working with Views and Storyboards
Adding an .xib or .storyboard File
Defining the Main User Interface
Displaying Multiple .xib Files
Zooming In and Out of a Storyboard
Defining the Initial Scene in a Storyboard
Displaying Scenes From a Segue
Removing a Scene After a Segue
Chapter 15: Choosing Commands with Buttons
Adding Images and Sounds to a Button
Connecting Multiple User Interface Items to IBAction Methods
Modifying Pop-Up Menu Items Visually
Adding Pop-Up Menu Items with Swift Code
Chapter 16: Making Choices with Radio Buttons, Check Boxes, Date Pickers, and Sliders
Chapter 17: Using Text with Labels, Text Fields, and Combo Boxes
Using a Secure Text Field, a Search Field, and a Token Field
Chapter 18: Using Alerts and Panels
Getting Feedback from an Alert
Chapter 19: Creating Pull-Down Menus
Adding New Pull-Down Menu Titles to the Menu Bar
Adding New Commands to a Pull-Down Menu
Connecting Menu Commands to Swift Code
Chapter 20: Protocol-Oriented Programming
Using Protocol Extensions to Extend Common Data Types
Chapter 21: Defensive Programming
Be Careful with Language Shortcuts
Working with Optional Variables
Working with Optional Chaining
Defining Errors with enum and ErrorType
Creating a Function to Identify Errors
Chapter 22: Simplifying User Interface Design
Working with Storyboard References
Chapter 23: Debugging Your Programs
Troubleshooting Breakpoints in Xcode
Chapter 24: Planning a Program Before and After Coding
Identifying the Purpose of Your Program
Designing the Structure of a Program
Designing the User Interface of a Program
Design a User Interface with Paper and Pencil
Design a User Interface with Software