Swift Talk

A weekly video series on Swift programming.

#29 Protocols & Class Hierarchies 16:02

We refactor a class hierarchy using a protocol and discuss the differences between both approaches.

Subscribers-Only

Subscribers Only

#24 Delegates & Callbacks 15:29

We discuss the pros and cons of delegates versus callback functions and why delegate protocols are always class only.

#21 Structs and Mutation 16:07

We look at multiple ways to change structs: mutation, functional chaining, and inout parameters. We discuss how they differ at the call site and why they’re all equivalent.

  1. inout
  2. Structs
  3. Mutation
  4. Value Types
October 21, 2016
Subscribers-Only

Subscribers Only

#20 Understanding Value Type Performance 18:51

In this episode we wrap NSMutableData in a struct while maintaining value semantics. Then we implement copy-on-write to make it efficient and discuss how the standard library uses the same approach.

  1. Copy-on-Write
  2. Structs
  3. Value Types
October 14, 2016

#17 Ledger GUI Architecture 18:31

We connect multiple view controllers using a central coordinating object and callback functions. Then we refactor the UI state into its own struct to simplify the control flow.

Subscribers-Only

Subscribers Only

#14 Growing Trees with Classes and Structs 28:11

We build a tree structure beginning with a flat array of Ledger account names. We first implement the tree using a class, and then we refactor it to a struct and discuss the differences and tradeoffs involved.

Subscribers-Only

Subscribers Only

#8 Networking: POST Requests 18:40

We extend the networking code from the first episode to support POST requests. Besides using Swift's enums with associated values and generics, we get to implement a map function on a custom data type.

#1 Networking 22:49

We explore an alternative approach to building the networking layer of an app. We make use of Swift's generics and structs to end up with simple, testable code.