Functional Programming in Swift

Introducing the Swift 4.0 Programming Language (One day)


This course is for experienced Swift developers who are new to Functional Programming. To book this course for your group, company, or public event see Booking and Availability.

What you'll learn


At the end of this day, you'll look at functions differently.

We begin by looking more closely at functions you use already. Next we explore higher order functions that either accept or return closures. We play with four canonical examples from the Swift Standard Library: map(), filter(), reduce(), and flatMap() and then create map() functions of our own. We finish with a look at MVC, MVVM, and maybe even a reactive style.

We assume that you are an experienced programmer who has spent some time looking at Swift but you are new to Functional Programming. This course shows you how to add elements of a functional style to Object-Oriented and Protocol-Oriented Programming.

What you need


You need a Mac running Sierra or High Sierra with the latest version of Xcode 9 installed. You'll create Swift 4 playgrounds and iOS 11 projects throughout the day.

Syllabus Highlights


Understanding Functions

Function Parameters

Favor Immutability

Value Types

Mutating Methods

Non-mutating Methods

Embracing Generics

Higher Order Functions

Closures

Returning Closures

Consuming Closures

Custom Operators

Capture Lists

Swift Standard Library

Map

Filter

Reduce

FlatMap

Functors and Monads

More with Map

Collections

Optionals

Error

Result

Non-Containers

FlatMap (Optional)

Architecture

MVC

MVVM

Reactive Style (Optional)