Weekly bite-sized screencasts on iOS development.

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.

Simulating Rope with UIKit Dynamics

Episode #141 | 23 minutes | published on 10/16/2014
Subscribers Only
In this episode we use UIKit Dynamics to create something fun: Rope! By attaching many segments together with attachments, we can simulate the physics of a rope. We also discover the best way to move an object on the screen in conjunction with existing attachments.

UIAttachments

Episode #140 | 9 minutes | published on 10/09/2014
Subscribers Only
In this episode we take another look at UIKit Dynamics, this time focusing on UIAttachmentBehavior, which allows you to create springs between elements to fix them in place or make them swing.

Today Extensions in iOS 8

Episode #139 | 12 minutes | published on 10/02/2014
Subscribers Only
One of iOS 8's more powerful new features is App Extensions. With extensions we have a whole new range of possibilities. In this episode we'll focus on the Today Extension, which is a way to add a widget to Notification Center for quick access.

IBDesignable

Episode #138 | 14 minutes | published on 09/25/2014
Subscribers Only
Finally iOS 8 and Xcode 6 are available and out of NDA and we can cover them on NSScreencast. There are tons of new features to cover, so today I'm just going to pick one: IBDesignable. With IBDesignable you can live preview your custom views so you don't have to stare at empty gray boxes in Interface Builder anymore. Interface Builder just got way more useful!

Fun with UIKit Dynamics

Episode #137 | 15 minutes | published on 09/18/2014
Subscribers Only
In this episode we explore the powerful UIKit Dynamics that was introduced with iOS 7. With Dynamics you can simulate real world interactions between your views. We'll go over the basics of collision, gravity, rigid bounds, and leave off with an example of why you shouldn't use it to make games.

Clipping Paths

Episode #136 | 24 minutes | published on 09/11/2014
Subscribers Only
In this episode we'll attempt to create the board for the game Connect Four. We'll leverage what we've learned about auto layout and create the connect four board constraints, then we'll draw the view. We have to draw it filled with a bunch of holes, so that we can see objects passing behind it. Using Core Graphics and clipping paths we can accomplish this effect.

Animating Constraints

Episode #135 | 15 minutes | published on 09/04/2014
Subscribers Only
What good is a static layout? When specifying layout using constraints, we still need to provide transitions and other animations in our interfaces. We can do this quite easily by just animating between different sets of constraints.

Visual Format Language

Episode #134 | 13 minutes | published on 08/28/2014
Subscribers Only
In this episode we explore Apple's Visual Format Language for building Auto Layout Constraints. While a bit strange at first glance, the Visual Format Language can really convey a lot of layout information in just a few characters in comparison to the manual building of NSLayoutConstraints can be.

Auto Layout in Code

Episode #133 | 18 minutes | published on 08/21/2014
Subscribers Only
In this episode we take a look at how to set up auto layout constraints in code, rather than with Interface Builder / Storyboards. Whether you prefer to work in code or storyboards to lay you user interfaces, often times setting things up in code is required. You'll see how to use NSLayoutConstraint to fully specify a layout, and hopefully understand a bit more about how auto layout works.

Realm

Episode #132 | 12 minutes | published on 08/14/2014
Subscribers Only
Realm is a new project that aims to replace Core Data and even SQLite for mobile app persistent storage needs. While an ambitious goal, I like seeing alternatives in this area, as Core Data is not always my favorite framework. In this episode we'll add Realm to a project and store a few rudimentary objects. We'll also see a quick way to query the data in the "realm".

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.

Swift JSON Redux - Part 1

Episode #130 | 30 minutes | published on 07/31/2014
Subscribers Only
In this episode we attempt to write a more idiomatic JSON Parsing framework leveraging Swift. To accomplish this we'll lean heavily on Swift's powerful enum features and apply a couple of custom operators to clean up syntax and reduce redundant code.

Swift JSON

Episode #129 | 13 minutes | published on 07/24/2014
Subscribers Only
In Swift, 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.

Swift Networking

Episode #128 | 15 minutes | published on 07/17/2014
Subscribers Only
In this episode we take a look at the NSURLSession API from a Swift perspective. We create a class to fetch JSON from an API, and along the way see lazy properties and type aliases.

Swift Operators

Episode #127 | 10 minutes | published on 07/10/2014
Subscribers Only
One of Swift's powerful features is the ability to define custom operators. In this episode we take a look at two examples of custom operators, one for easy regular expression matching, and another for computing the dot product between two vectors.

Swift Classes

Episode #126 | 11 minutes | published on 07/03/2014
Subscribers Only
Continuing on with our Swift exploration, we focus this time on Swift classes. We talk about initializers, inheritance, protocols, type inspection, and more.

Swift Basics

Episode #125 | 12 minutes | published on 06/26/2014
Subscribers Only
In this episode we take a first look at Apple's brand new programming language Swift.

Method Swizzling

Episode #124 | 16 minutes | published on 06/19/2014
Subscribers Only
In this episode we delve into the wonderful Objective-C runtime in order to replace method implementations with our own. Using this technique we can add or change behavior to existing classes, which can be extremely useful for Aspect Oriented Programming (logging/benchmarking), or analytics.

STHTTPRequest

Episode #123 | 13 minutes | published on 06/13/2014
Subscribers Only
In this episode I take a look at a lightweight network library called STHTTPRequst. Specifically I like two features it provides: easy curl logging of outgoing requests, and a test response queue for performing unit tests against canned responses. Whether or not you want to use this library, there are some good things to learn here.