Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
assignment1reading.md 5.14 KiB

Reading Assignment #1

Due: Feb 2, 2020, 11:59 pm, v1

Quiz

The quiz is a relatively easy jaunt over the following reading, but it is timed: you will have only 30 minutes to complete the quiz after you have started it.

Therefore, I encourage you to read all the assigned reading ahead of time, as 30 minutes might not be sufficient to look up all the answers. More importantly, you will be using all of this information in your projects.

This is individual work; you may not collaborate with others. You may use online resources to complete the quiz.

Objective

The goal of this and the next reading assignments is to do a breadth-first scan of the entire Swift language. You can take a quick tour here, and feel free to consult the language reference, but your main reading is the Swift Language Guide. Weird / important topics are in bold.

This "assignment" consists of taking the above quiz on this material.


The Basics

  • Constants and Variables Comments
  • Semicolons
  • Integers
  • Floating-Point Numbers
  • Type Safety and Type Inference
  • Numeric Literals
  • Numeric Type Conversion
  • Type Aliases
  • Booleans
  • Tuples
  • Optionals
  • Error Handling
  • Assertions and Preconditions

Basic Operators

  • Terminology
  • Assignment Operator
  • Arithmetic Operators
  • Compound Assignment Operators
  • Comparison Operators
  • Ternary Conditional Operator
  • Logical Operators

Strings and Characters

  • String Literals
  • Initializing an Empty String
  • String Mutability
  • Strings Are Value Types
  • Working with Characters
  • Concatenating Strings and Characters
  • String Interpolation
  • Unicode
  • Comparing Strings
  • Unicode Representations of Strings

Collection Types

  • Mutability of collections
  • Arrays
  • Sets
  • Performing Set Operations
  • Dictionaries

Control Flow

  • For-In Loops
  • While Loops
  • Conditional Statements
    • If
    • Switch
      • No Implicit Fallthrough
      • Interval Matching
      • Tuples
      • Value Bindings
      • Where
      • Compound Cases
  • Control Transfer Statements
    • Continue
    • Break
    • Fallthrough
    • Labeled Statements
  • Early Exit
  • Checking API Availability

Functions

  • Defining and Calling Functions
  • Function Parameters and Return Values
    • Functions Without Parameters
    • Functions With Multiple Parameters
    • Functions Without Return Values
    • Functions With Multiple Return Values
  • Function Argument Labels and Parameter Names
    • Specifying Argument Labels
    • Omitting Argument Labels
    • Default Parameter Values
    • Variadic Parameters
    • In-Out Parameters
  • Function Types
  • Nested Functions

Closures

Enumerations

Structures and Classes

  • Comparing Classes and Structures
  • Structures and Enumerations Are Value Types
  • Classes Are Reference Types
  • Choosing Between Classes and Structures
  • Assignment and Copy Behavior for Strings, Arrays and Dictionaries

Properties

  • Stored Properties
  • Computed Properties
  • Property Observers
  • Global and Local Variables
  • Type Properties

Methods

  • Instance Methods
    • The self Property
    • Modifying Value Types from Within Instance Methods
    • Assigning to self Within a Mutating Method
  • Type Methods

Subscripts

Inheritance

  • Defining a Base Class
  • Subclassing
  • Overriding
    • Accessing Superclass Methods, Properties, and Subscripts
    • Overriding Methods
    • Overriding Properties
  • Preventing Overrides

Initialization

  • Setting Initial Values for Stored Properties
  • Customizing Initialization
  • Default Initializers
  • Class Inheritance and Initialization
  • Failable Initializers
  • Required Initializers
  • Setting a Default Property Value with a Closure or Function

Deinitialization

Optional Chaining

Error Handling

Type Casting

Nested Types

Extensions

  • Extension Syntax
  • Computed Properties
  • Initializers
  • Methods
    • Mutating Instance Methods
  • Subscripts
  • Nested Types

Protocols

Generics

Automatic Reference Counting

Memory Safety

Access Control

Advanced Operators