Swift Talk

A weekly video series on Swift programming.

Subscribers-Only

Subscribers Only

#18 Adding Search to the Ledger GUI App 16:00

In this episode, we implement search functionality for our Ledger GUI app. In the process, we leverage several aspects we've talked about before, such as connecting view controllers, managing application state, and parsing user input.

  1. Architecture
  2. Parsing
September 30, 2016
Subscribers-Only

Subscribers Only

#32 Array, ArraySlice & Collection (Collections #1) 15:16

We show how to make an extension on array available to other collections: first, we implement it for array slices, then we implement it as a protocol extension for all collections.

#15 Building Parser Combinators (Part 1) 16:22

We implement the basic building blocks of a parser combinator library. Join us in the functional programming gym to stretch your object-oriented comfort zone!

Subscribers-Only

Subscribers Only

#16 Building Parser Combinators (Part 2) 21:30

We continue to implement some of the more challenging parts of parser combinators. Join us for mental gym session part two!

Subscribers-Only

Subscribers Only

#22 Command Line Tools with Swift 17:17

We show how we build simple command line tools leveraging the Cocoa frameworks. We use the Swift Package manager to include dependencies in our project.

  1. Command Line
  2. Package Management
October 28, 2016

#5 Connecting View Controllers 20:14

We refactor our code by moving the app's flow from the storyboard into a separate class. Our goal is to manage the view controller flow from a central place so that view controllers don't have implicit knowledge of their context.

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.

#11 Evaluating Expressions 29:36

We write an evaluator for a simple expression language. We write our code in a test-driven way, which saves us time and helps us verify the correctness the code.

Subscribers-Only

Subscribers Only

#12 Evaluating Transactions 25:43

We evaluate transactions using the code from the previous episode. We need continuous refactoring to keep our code simple and clean.

#19 From Runtime Programming to Functions 23:05

We build a flexible sort descriptor abstraction, similar to NSSortDescriptor, on top of Swift's native sort methods. Because we make use of generics and first-class functions, the result is dynamic and type safe.

Subscribers-Only

Subscribers Only

#6 Generic Table View Controllers 19:42

We explore how Swift's generics can be used to create a simple, reusable table view controller. As a welcome side effect, this process helps us keep our view controller code clean.

Subscribers-Only

Subscribers Only

#26 Generic Table View Controllers (Part 2) 23:30

We show how you can build a generic, type-safe table view controller that can display different types of items using multiple cell classes.

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

#30 Interfaces 16:07

We talk about the importance of types and interfaces as tools to express your intent precisely and to set the proper boundaries.

  1. Architecture
  2. Generics
  3. Types
December 30, 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.

#3 Loading View Controllers 21:50

Many view controllers have to load data asynchronously. We explore different options to factor out this code using protocols, container view controllers, and generics.

#31 Mutating Untyped Dictionaries 15:14

We solve an interesting challenge from a Stack Overflow question: mutating a nested untyped dictionary. In the process, we discuss the mutability of value types and the concept of l-values.

  1. Mutation
  2. Value Types
January 6, 2017

#25 Network Caching 23:33

We come back to our unfinished Swift Talk iOS app and implement a lightweight network cache for offline support. We keep our networking code from episode #1 untouched to maintain a clear separation of concerns.

#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.

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.

#13 Parsing Techniques 25:23

We look at two different techniques to parse a simple expression language: handwritten parsers and parser combinators.

#10 Project Introduction: Ledger GUI 07:45

We show a quick overview of our new project: a bookkeeping app that's based on plain text.

  1. Ledger
  2. Overview
August 12, 2016

#29 Protocols & Class Hierarchies 16:02

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

#9 Q&A 13:54

In this episode, we answer some of the questions we've received over the past few weeks. We cover networking, table views, stack views, our App class, and testing.

Subscribers-Only

Subscribers Only

#2 Rendering CommonMark 23:15

We create attributed strings from CommonMark. We continually refactor our code to make the central logic short and understandable.

Subscribers-Only

Subscribers Only

#4 Rendering CommonMark (Part 2) 18:33

We continue building the CommonMark renderer we started in episode #2. This time, we add customizable styles using structs and inout parameters.

#33 Sequence & Iterator (Collections #2) 16:54

We continue to make the collection extension from the last episode more generic: we implement it on the Sequence protocol and discuss infinite sequences in the process.

#23 Splitting Arrays 24:07

We talk about a familiar but surprisingly tricky problem: splitting an array into groups of elements. We discuss the pros and cons of our own solutions along with the solutions people sent us via Twitter!

  1. Algorithms
  2. State
  3. QA
November 4, 2016

#7 Stack Views with Enums 21:43

Stack Views are great for prototyping. To make them even easier to set up in code, we create an abstraction using enums to specify UI elements in a declarative style.

#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. Mutation
  2. inout
  3. Structs
  4. Value Types
October 21, 2016

#27 Typed Notifications (Part 1) 17:52

We build a lightweight generic wrapper around Foundation's notification API. This allows us to abstract away common boilerplate code and to work with a type-safe interface.

Subscribers-Only

Subscribers Only

#28 Typed Notifications (Part 2) 18:02

We extend the typed notifications code from the last episode to custom notifications and discuss an alternative protocol-based approach.

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