Learning Swift – Part 3
A collection contains multiple values. In Swift there are two types of collections: Arrays and Dictionaries. An array stores an ordered list of values, whereas a dictionary stores an unordered list of values that are accessed using keys.
What is an array
Learn about the first collection type known as an Array, which is an ordered list of values.
Modifying an array
Just like any variable an Array is mutable where you can append, insert or delete items from the Array.
What is a dictionary
A Dictionary is an unordered list of key and value pairs that is a collection with a valuable purpose.
In computer programming the order in which lines of code are evaluated can be altered by control flow statements. These statements can be conditional, whether or not code should be executed. They can also be loops, which determine how many times code should be executed
The For-In is a fast enumeration looping mechanism which allows you to iterate over each item in an array.
While and do-while loop
A freeform loop which allows you to loop while a condition is a true.
A classic loop construct which requires an index, condition, and increment. Usually used to index into array.
The if statement is a conditional statement that allows you to change the flow of program execution based on certain conditions.