Skip to Content
Swift OS X Programming for Absolute Beginners
book

Swift OS X Programming for Absolute Beginners

by Wallace Wang
August 2015
Beginner content levelBeginner
572 pages
12h 22m
English
Apress
Content preview from Swift OS X Programming for Absolute Beginners

Chapter    7

Making Decisions with Branches

After a program receives data, it needs to manipulate that data somehow to return a useful result. Simple programs manipulate data the same way, but more complicated programs need to make decisions on how to manipulate that data.

For example, a program might ask the user for a password. If the user types in a valid password, then the program gives the user access. If the user does not type in a valid password, then the program must display an error message and block access.

When a program analyzes data and makes a decision based on that data, it uses something called Boolean values and branching statements.

Boolean values represent either a true or false value. Branching statements give your program ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Swift for Absolute Beginners

Swift for Absolute Beginners

Gary Bennett, Brad Lees

Publisher Resources

ISBN: 9781484212332Purchase book