-
Peter J. Keleher authoredPeter J. Keleher authored
Reading Assignment #1
Due: Feb 2, 2020, 11:59 pm, v1
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.
- Constants and Variables Comments
- Semicolons
- Integers
- Floating-Point Numbers
- Type Safety and Type Inference
- Numeric Literals
- Numeric Type Conversion
Type AliasesBooleansTuples- Optionals
Error HandlingAssertions and Preconditions
- Terminology
- Assignment Operator
- Arithmetic Operators
- Compound Assignment Operators
- Comparison Operators
- Ternary Conditional Operator
- Logical Operators
- 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
- Mutability of collections
- Arrays
- Sets
- Performing Set Operations
- Dictionaries
- 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
- 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 ParametersIn-Out Parameters
Function Types- Nested Functions
Closures
Enumerations
- 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
- Stored Properties
Computed Properties- Property Observers
- Global and Local Variables
- Type Properties
- Instance Methods
- The self Property
- Modifying Value Types from Within Instance Methods
Assigning to self Within a Mutating Method
- Type Methods
Subscripts
- Defining a Base Class
- Subclassing
- Overriding
- Accessing Superclass Methods, Properties, and Subscripts
- Overriding Methods
Overriding Properties
- Preventing Overrides
- Setting Initial Values for Stored Properties
- Customizing Initialization
- Default Initializers
Class Inheritance and InitializationFailable InitializersRequired InitializersSetting a Default Property Value with a Closure or Function
Deinitialization
Optional Chaining
Error Handling
Type Casting
Nested Types
- Extension Syntax
- Computed Properties
Initializers- Methods
- Mutating Instance Methods
SubscriptsNested Types
Protocols
Generics
Automatic Reference Counting
Memory Safety
Access Control
Advanced Operators