With iOS 10, tvOS 10, and watchOS 3, Apple is introducing a new framework called the UserNotifications framework. This brand new set of APIs provides a unified, object-oriented way of working with both local and remote notifications on these platforms. This is particularly useful as, compared to the existing APIs, local and remote notifications are now handled very similarly, and accessing notification content is no longer done just through dictionaries.

In this tutorial, I’ll go through the basics of this new framework and show how you can easily take advantage of it to support notifications for your applications.

This tutorial requires that you are running Xcode 8 with the latest iOS, tvOS, and watchOS SDKs.

Read More »


With the latest changes in Xcode 7.3, you can once again build drag-and-drop playgrounds to provide simple Swift-based utility apps with minimal coding.

Unlike older solutions, XCPlayground’s interactive live views don’t require pop-up windows. You don’t have to do anything special to make the page application run with a different priority. Just open the assistant and the app is there, running, and interactive.

Read More »


Coming from a Ruby background, Xcode – and IDEs in general – never really feels like home to me. I often miss Vim and hope to get as much done in the terminal as possible.

Working in the IDE, I often feel there’s a lot hidden out of sight. Hidden behind config files, property lists, some unknown IDE defaults. A lot I don’t know and a lot that gets done for me rather than by me. Surely there’s some benefit to that. But the downside is that the inner workings of an application can be poorly understood.

Read More »


Swift, true to its name, is moving fast. This week marks the beta release of Swift 1.2, a major update to the language. The Swift team has responded to so many of the community’s requests in one fell swoop, we’re overflowing with new and exciting features. Every line-item in this announcement is a big advancement: incremental builds, improved error messages and stability in Xcode, static class properties, support for C unions and bitfields, bridging of Swift enums to Objective-C, safer type casting, improvements to single-line closures, and more.

Read More »


I rarely use comments when I’m coding1. I do make one exception though; using // TODO: and // FIXME: to highlight pieces of code I need to revisit at a later date.

Jeffrey Sambells wrote a post on how to flag these comments as Xcode warnings but that only applies for Objective-C. With a slight tweak, here is a run script build phase for flagging TODO: and FIXME: as warnings in a Swift project.

Read More »


Syntax can become extremely verbose when working with many APIs in the iOS SDK with Swift, and Quartz is no exception.

Here’s a library that provides a more convenient syntax when using Swift with Quartz and related frameworks such as Core Image, and Core Graphics called SwiftGraphics from Jonathan Wight.

Here’s some of the features provided by SwiftGraphics:

  • Operator overloading for CoreGraphics types
  • Quadtree data structures
  • Object oriented extensions for CGContext and CGPath
  • Easy creation of geometry objects
  • Convex hull generation
  • An Xcode 6 playground

With UIKit Dynamics you can specify collision behaviours to your objects. The dynamic items can collide with each other and/or any boundary you specify. In this tutorial we will create some custom boundaries and randomly let some squares fall down on to these boundaries. This tutorial is built in iOS 8.1 and Xcode 6.1

Read More »