Introduction to Swift

Swift Kickstart and Thinking in Swift (Two days)

Who it's for


This two day introductory course is for experienced developers who are new to Swift.

What you'll learn


This two-day, intensive class introduces combines the Swift Kickstart and Thinking in Swift classes.

We begin day one with a simple iOS sample project and quickly move to a hands-on exploration of Swift functions, variables and constants, and collections. You'll create higher order functions, work with generics, and be introduced to optionals.

During the second part of day one you will investigate Swift types as you create and use instances of Swift classes, structs, and enumerations. You'll experiment with methods, subclasses and properties and learn to harness the power of polymorphism through protocols and protocol extensions. We finish the day with another iOS project that uses much of what you learned to create a simple MVVM project.

Swift has been changing quickly over the past year. On day two you'll learn to embrace the latest Swift 3 conventions.

What you need


You need a Mac running El Capitan or Sierra with the latest version of Xcode 8 installed. You'll create Swift playgrounds and iOS project.

Booking Info


For information about booking a course for your group, company, or public event or more details on course content, contact booking@editorscut.com.

Syllabus


A Simple iOS Project

Hello, World! (it's kind of the law)

Quick introduction to Xcode 8

A moment with GUI creation in Interface Builder

Swift Properties and Methods

Connecting Outlets and Actions in Swift

The iOS lifecycle

Meet the iOS Simulator

Language Fundamentals

Functions

Explore a playground in Xcode 8

Create and call functions

Function overloading in Swift

Default values for parameters

Local and external parameter names

Tuples and variadic parameters

Variables and Constants

Strong type inference in Swift

Let vs. Var

No promotion of numeric types

Where spaces matter

Functions as objects

Optionals and Nil

Collections

Create and modify arrays

Collections are homogeneous

Iterating an array

Value and Reference Types

Create and modify dictionaries

A Quick look at Sets

Types and Instances

Classes

Base classes

Subclasses

Stored and Computed Properties

By-reference semantics

The init method

Convenience methods

More optionals

Overriding methods

Enumerations

Case

Switch

Raw values and more optionals

Methods

Computed properties

As property types

Value Types

Associated values

Structs

Properties

By-value semantics

Default init

Getters and setters

Did set and will set

Mutating methods

Protocols

Collecting commonality

Conforming

Polymorphism

Self

Generics

Protocol extensions

Extension points

Thinking in Swift

Flexible Functions

Understanding Parameters

Inout parameters

Closures

Generics

Extensions

Mutable Model

Non-Mutable Model

Sequences

Distributions

Raw Representables

while let/p>

Iterators

Sequences

Subscripts

When Things Go Wrong

Asserts

ErrorProtocol Structs

ErrorProtocol Enums

Throws

Try/Catch

Defer

Guard Let

Rethrow

Higher-Order Functions

Returning a Function

Returning a Closure

Consuming a Closure

Mapping Arrays

Classic Examples

Map

Filter

Reduce

FlatMap

Functors and Monads