Downloading, Caching & Decoding Images Asynchronously with Alamofire: Part 1

September 18, 2016 | Swift, Alamofire, Networking, iOS, macOS

Downloading and caching images are common tasks in iOS development, especially when using collection and table views. In this tutorial, we're going to use the popular Swift networking library Alamofire and its companion image library AlamofireImage to build an app that displays images of Glacier National Park.

Making Private, Cross-Platform Swift Frameworks With CocoaPods

July 10, 2016 | Swift, Dependency Management, CocoaPods, iOS, macOS, tvOS, watchOS

With technologies like handoff and continuity, a unified developer program, and many of the same system frameworks available on all four of its platforms, Apple has been moving over the past few years to more seamlessly integrate its ecosystem of devices. This presents a great opportunity for us to bring our apps to . . .

Using Switch Statements for Type Checking in Swift

January 16, 2016 | Swift, Control Flow, iOS, macOS, tvOS, watchOS

One thing that bothers many developers about using if statements for type checking in Objective-C is that it suggests a specific order of importance. For example, here's how you might use type checking in an Objective-C prepareForSegue method . . .

Changing UITableViewCell Selection Color in Storyboards with IBInspectable

January 13, 2016 | Swift, Table Views, UIKit, iOS

Recently I needed to change the cell selection color of a UITableViewCell. This can be done in a few lines of code using the "selectedBackgroundView" property on UITableViewCell. But since the ultimate goal is simply to change the selection color, it would be nice to have an attribute in storyboard . . .

Swift Enums: Initialization with Associated Values from a Server Response

January 10, 2016 | Swift, Enumerations, iOS, macOS, tvOS, watchOS

Swift Enumerations with Associated Values are a powerful way to represent a group of related values that may be associated with different types. The Apple documentation on enums uses the example of an inventory tracking system with different types of barcodes, UPCA and QR. UPCA and QR codes are both "Barcode" values so . . .