Skip to content

Firanus/swift-language-guide-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Language Guide Notes

This repository compiles notes made on the Swift language guide. The order in which the notes were made was dictated by the Stanford course 'Developing iOS 11 apps with Swift', and the releases reflect the reading exercises made in that course. As a result, if you are following along with the official Swift Language Guide, there will be small differences in the order topics are covered

Attempts have been made to keep the notes as brief as possible, and omit content that would be intuitive to a programmer with some experience of Object Oriented Languages. If you ever feel you need more detail, there is no better source than the official language guide itself. Each note is also linked to the appropriate section of the language guide.

Table of Contents

  1. The Basics 0. Intro
    1. Constants and Variables
    2. Comments
    3. Semicolons
    4. Integers
    5. Floating Point Numbers
    6. Type Safety and Type Inference
    7. Numeric Literals
    8. Numeric Type Conversion
    9. Type Aliases
    10. Booleans
    11. Tuples
    12. Optionals
    13. Error Handling
    14. Assertions and Preconditions
  2. Basic Operators 0. Intro
    1. Terminology
    2. The Assignment, Arithmetic and Logical Operators
    3. Comparison Operators
    4. Ternary Coniditonal Operator
    5. Nil-Coalescing Operator
    6. Range Operators
  3. Strings and Characters 0. Intro
    1. Unicode
    2. Counting Characters
    3. Accessing and Modifying a String
    4. Substrings
    5. Comparing Strings
    6. Unicode Representations of Strings
  4. Collection Types 0. Intro
    1. Arrays
    2. Dictionaries
    3. Sets
    4. Performing Set Operations
  5. Control Flow 0. Intro
    1. For-in loops
    2. Switch Statements
    3. Control Transfer Statements
    4. Early Exit
  6. Functions 0. Intro
    1. Argument Labels and Parameter Names
    2. Functions with Multiple Return Values
    3. Function Types
  7. Classes and Structures 0. Intro
    1. Comparing Classes and Structures
    2. Structures and Enumerations are Value Types
    3. Classes are Reference Types
    4. Choosing Between Classes and Structures
  8. Properties 0. Intro
    1. Stored Properties
    2. Property Observers
    3. Computed Properties
  9. Methods 0. Intro
    1. Instance Methods
  10. Inheritance
  11. Initialization 0. Intro
    1. Setting Initial Values for Stored Properties
    2. Customizing Initialization
    3. Default Initializers
    4. Initializer Delegation for Value Types
    5. Class Inheritance and Initialization
    6. Class Initialization has Two Phases
    7. Initializer Inheritance and Overriding
    8. Failable Initialisers
    9. Required Initialisers
    10. Setting a Default Property Value with a Closure or Function
  12. Closures 0. Intro
    1. Closure Expressions
    2. Trailing Closures
    3. Capturing Values
    4. Closures are Reference Types
  13. Enumerations 0. Intro
    1. Enumeration Syntax
    2. Matching Enumeration Values with a Switch Statement
    3. Associated Values
    4. Raw Values
    5. Recursive Enumerations
  14. Subscripts 0. Intro
    1. Subscript Syntax
    2. Subscript Options
  15. Optional Chaining 0. Intro
    1. Linking Multiple Levels of Chaining
  16. Nested Types
  17. Extensions
  18. Protocols 0. Intro
    1. Property Requirements
    2. Method Requirements
    3. Initializer Requirements
    4. Protocols as Types
    5. Delegation
    6. Adding Protocol Conformance with an Extension
    7. Protocol Inheritance and Class-only Protocols
    8. Protocol Composition
    9. Protocol Extensions
  19. Error Handling
  20. Type Checking

Stanford iOS Reading Exercised

The guide below outlines the order you should read these notes in if you are following the Stanford iOS course, and wish to complete the reading exercises in the same order.

Reading 1

Read all of sections 1 - 11, with the following exceptions:

  • Section 1.11 - Tuples
  • Section 3.6 - Unicode Representations of Strings
  • Section 4.3 - Sets
  • Section 4.4 - Performing Set Operations
  • Part of Section 5.2. Ignore everything related to Tuples
  • Part of Section 6.1 - Ignore Variadic Parameters and In-Out Parameters
  • Section 6.2 - Functions with Multiple Return Values
  • Section 6.3 - Function Types
  • Section 8.3 - Computed Properties
  • Part of Section 10 - Ignore Overriding Properties
  • Section 11.5 - 11.10 - Initializers

Reading 2

Read all of the items in sections 1-11 that were omitted for Reading 1 (listed just above), and Sections 12-18.

About

A collection of notes made on the Swift language guide.

Resources

Stars

Watchers

Forks

Packages

No packages published