Weekly bite-sized screencasts on iOS development.

There are 14 episodes with tag 'swift'   Clear search

Poker Hands - Part 1

Episode #248 | 47 minutes | published on 12/22/2016
Free Video
In this episode I am joined by Soroush Khanlou. Together we pair up to implement the Poker Hands Kata. We start off by parsing the raw string input into structured types, complete with tests.

Poker Hands - Part 2

Episode #249 | 37 minutes | published on 12/22/2016
Subscribers Only
In this episode I am joined again by Soroush Khanlou. We continue our exploration of the Poker Hands kata, focusing on fleshing out our types. We also begin matching poker hands, leveraging enums with associated types.

Yahtzee Kata

Episode #247 | 30 minutes | published on 12/08/2016
Subscribers Only
In this episode we will implement the Yahtzee Kata, which entails scoring hands based on dice rolls. We'll look at leveraging protocols and protocol extensions to mix & match shared behaviors across disparate types in order to perform matching and scoring of the dice.

Improved Guard Setup for Swift

Episode #246 | 7 minutes | published on 12/01/2016
Subscribers Only
In the last episode we showed how to run Swift tests automatically with guard, but it wasn't an ideal setup. We couldn't see compiler errors, nor could we see any output from our program using print. In this episode we leverage Ruby's open3 library to capture stdout and stderr so we can output it to the terminal in the appropriate colors.

Fizz Buzz Kata

Episode #245 | 16 minutes | published on 11/24/2016
Subscribers Only
Code Katas are interesting challenges that can help you practice programming. Some are extremely difficult and others are fairly easy, but they all allow us to exercise the act of programming. Doing code katas can help you learn a new programming language, a new algorithm, or a new style of programming.In this episode we’ll tackle one of the most trivial katas: FizzBuzz.

Swift 3

Episode #237 | 20 minutes | published on 09/29/2016
Subscribers Only
Swift 3 is now out and contains a host of new features and syntax changes. In this episode we'll look at a few of the more common changes you'll run into when upgrade projects to Swift 3 including implicit method argument labels, dropping the NS prefix on a bunch of classes, and the new Swift API naming guidelines.

Poker Hands - Part 3

Episode #250 | 45 minutes | published on 01/05/2017
Subscribers Only
In this final episode in the Poker Hands Kata with Soroush Khanlou, we finish off by improving the design of our program, improving our tests, and implementing the remaining features for detecting the more complicated hands.

Swift 2 Optionals

Episode #191 | 8 minutes | published on 10/08/2015
Free Video
In this free episode, we take a look at a core Swift 2 feature: Optionals. Unlike Objective-C, where nil is considered a no-op, in Swift nil is specifically recognized by the compiler, which forces you to handle cases where nil might be present in a variable.

Swift JSON

Episode #129 | 13 minutes | published on 07/24/2014
Subscribers Only
Parsing JSON (which provides no contracts or type guarantees) can be difficult and tedious in Swift. Many of the problems you are forced to deal with were easier to ignore in Objective-C, but that doesn't mean they weren't present. In this episode we'll take a look at a very manual approach to mapping from a JSON response to a Swift type.

Flat Map

Episode #143 | 25 minutes | published on 10/30/2014
Subscribers Only
In this episode we cover a horribly named, yet fairly powerful concept called flat map. We'll use this technique to solve the problem we discovered last time dealing with Result<T> and having to use a switch statement everywhere.

Swift JSON Redux Part 2

Episode #131 | 10 minutes | published on 08/07/2014
Subscribers Only
In this episode we wrap up our JSON parsing exploration in Swift by extending the decoding to work with arrays. Doing so cleans up the extraction code significantly.

Error Handling in Swift

Episode #142 | 12 minutes | published on 10/23/2014
Subscribers Only
In this episode I talk about the pattern of communicating errors in Cocoa and how it can be improved by leveraging features in Swift. By introducing a Result type that is generic and applies to any type, it appears useful, however we run into some cumbersome use cases that will require further discussion.

Swift Grab Bag

Episode #251 | 9 minutes | published on 01/13/2017
Subscribers Only
In this episode we cover some lesser-known features of Swift, including @discardableResult, escaping closures, defer, and using dump versus print for better debugging output.

Sourcery

Episode #261 | 12 minutes | published on 03/23/2017
Subscribers Only
Writing boilerplate code can get tedious and boring. It can also lead to code duplication, which means it becomes a liability to keep in sync. Sourcery is a code generation tool that can help leverage your existing types and reflect on them in order to generate useful bits of code. In this episode Sam Soffes shows us how to install and use Sourcery, how to integrate it with Xcode’s build system, and how to create a simple Sorcery template to automatically count the number of items in a Swift enum and add it as an option.