Please note, this blog entry is from a previous course. You might want to check out the current one.
The first part of the first project is an reading assignment of the Swift Programming Language.
The following sections are very important and need to be read very carefully:
- The Basics – Constants and Variables
- The Basics – Type Safety and Type Inference
- The Basics – Booleans
- The Basics – Optionals
- Strings and Characters – Strings Are Value Types
- Strings and Characters – String Interpolation
- Strings and Characters – Counting Characters
- Collection Types – Mutability of Collections
- Collection Types – Arrays
- Control Flow – Conditional Statements
- Control Flow – Control Transfer Statements
- Functions – Defining and Calling Functions
- Functions – Function Parameters and Return Values
- Functions – Function Types
- Closures – Closure Expressions
- Classes and Structures – Comparing Classes and Structures
- Properties – Stored Properties
- Properties – Computed Properties
The following sections are important but are not too difficult:
- The Basics – Comments
- The Basics – Assertions
- Basic Operators – Terminology
- Basic Operators – Assignment Operator
- Basic Operators – Arithmetic Operators
- Basic Operators – Compound Assignment Operators
- Basic Operators – Comparison Operators
- Basic Operators – Ternary Conditional Operator
- Basic Operators – Logical Operators
- Strings and Characters – Initializing an Empty String
- Strings and Characters – Working with Characters
- Strings and Characters – Comparing Strings
- Functions – Nested Functions
- Closures – Trailing Closures
The following sections are important but quite basic:
- The Basics – Semicolons
- The Basics – Integers
- The Basics – Floating-Point Numbers
- Basic Operators – Range Operators
- Strings and Characters – String Literals
- Strings and Characters – String Mutability
- Strings and Characters – Concatenating Strings and Characters
- Control Flow – For Loops
- Control Flow – While Loops
The following sections are currently not required, but might be in future sessions:
- The Basics – Numeric Literals
- The Basics – Numeric Type Conversion
- The Basics – Type Aliases
- The Basics – Tuples
- Basic Operators – Nil Coalescing Operator
- Strings and Characters – Unicode
- Strings and Characters – Unicode Representations of Strings
- Functions – Function Parameter Names
- Closures – Capturing Values
- Closures – Closures are Reference Types
- Classes and Structures – Structures and Enumerations are Value Types
- Classes and Structures – Classes are Reference Types
- Classes and Structures – Choosing Between Classes and Structures
- Classes and Structures – Assignment and Copy Behavior for Strings, Arrays, and Dictionaries
- Properties – Property Observers
- Properties – Global and Local Variables
- Properties – Type Properties
Additional Notes:
- Though you can use emoticons in variable names, don’t do it.
- Use semicolons only to separate multiple statements in a single line.
- A string can be converted to an array of characters using:
let myArrayOfCharacters = Array(myString)
- Trying to access an index in an array higher than its count results in a crash.
- The array function last returns an optional.
- The += array operator requires another array.
- The switch statement is much more important than in other languages.