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    9

Arrays and Dictionaries

Almost every program needs to accept data so it can manipulate that data and calculate a useful result. The simplest way to store data temporarily is through variables that can store numbers or text strings. However, what if you need to store multiple chunks of data such as a list of names or a list of product numbers? You could create multiple variables like this:

var employee001, employee002, employee003 : String

Unfortunately, creating separate variables to store related data can be clumsy. What if you don’t know how many items you need to store? Then you may create too many or not enough variables. Even worse, storing related data in separate variables means it’s easy to overlook the relationship between ...

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