Typed Notifications (Part 1)
#27 · December 2, 2016 · 18 minutes

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.

Generic Table View Controllers (Part 2) Subscriber only
#26 · November 25, 2016 · 24 minutes

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

Network Caching
#25 · November 18, 2016 · 24 minutes

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.

Delegates & Callbacks Subscriber only
#24 · November 11, 2016 · 15 minutes

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

Splitting Arrays
#23 · November 4, 2016 · 24 minutes

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!

Command Line Tools with Swift Subscriber only
#22 · October 28, 2016 · 17 minutes

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.

Structs and Mutation
#21 · October 21, 2016 · 16 minutes

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.

Understanding Value Type Performance Subscriber only
#20 · October 14, 2016 · 19 minutes

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.

From Runtime Programming to Functions
#19 · October 7, 2016 · 23 minutes

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.

Adding Search to the Ledger GUI App Subscriber only
#18 · September 30, 2016 · 16 minutes

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.

Ledger GUI Architecture
#17 · September 23, 2016 · 19 minutes

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.

Building Parser Combinators (Part 2) Subscriber only
#16 · September 16, 2016 · 22 minutes

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

Building Parser Combinators (Part 1)
#15 · September 9, 2016 · 16 minutes

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!

Growing Trees with Classes and Structs Subscriber only
#14 · September 2, 2016 · 28 minutes

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.

Parsing Techniques
#13 · August 26, 2016 · 25 minutes

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

Evaluating Transactions Subscriber only
#12 · August 19, 2016 · 26 minutes

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

Evaluating Expressions
#11 · August 12, 2016 · 30 minutes

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.

Project Introduction: Ledger GUI
#10 · August 12, 2016 · 8 minutes

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

Q&A
#9 · August 5, 2016 · 14 minutes

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.

Networking: POST Requests Subscriber only
#8 · July 29, 2016 · 19 minutes

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.

Stack Views with Enums
#7 · July 22, 2016 · 22 minutes

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.

Generic Table View Controllers Subscriber only
#6 · July 15, 2016 · 20 minutes

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.

Connecting View Controllers
#5 · July 8, 2016 · 20 minutes

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.

Rendering CommonMark (Part 2) Subscriber only
#4 · July 1, 2016 · 19 minutes

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

Loading View Controllers
#3 · June 24, 2016 · 22 minutes

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

Rendering CommonMark Subscriber only
#2 · June 17, 2016 · 23 minutes

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

Networking
#1 · June 17, 2016 · 23 minutes

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.