Building A PDF Viewer With PDFKit in iOS 11

January 16, 2018 | Swift, PDFKit, iOS, macOS

PDFKit has been available to Mac developers since 10.4, but with iOS 11 Apple brought its support for viewing, editing, and authoring PDFs to iPhone and iPad. Previously, viewing PDF files meant rendering each page yourself with Core Graphics and Core Text, using an indirect solution like UIWebView or QuickLook, or . . .

Keychain Services Core Concepts

January 9, 2018 | Swift, Authentication, Security, iOS, macOS, tvOS, watchOS

Most apps need to store sensitive user information at some point. Most commonly it's a service-specific credential like a password or authentication token, but it could also be an encryption key, expiration date, or really anything private to the user that shouldn't be easily accessible on the device.

Machine Learning in Swift: Document Classification with Core ML

January 2, 2018 | Swift, Machine Learning, Core ML, iOS, macOS, tvOS, watchOS

It's an exciting time for Swift developers to get into machine learning. With Apple's new Core ML framework, support on all four platforms, and a growing library of models available for the framework, incorporating machine learning solutions in Swift apps has never been easier.

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

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

In Part 1 of this tutorial, I explained how to use the Alamofire and AlamofireImage libraries to asynchronously download and cache images to be displayed in a UICollectionView. At the end of that project, we still had a performance problem. UIImage by default waits until right before display to decode . . .

Serializing & Archiving Structs in Swift with Archiver

October 26, 2016 | Swift, Serialization, iOS, macOS

There are many options for persisting data between launches in Cocoa apps, including NSUserDefaults, NSKeyedArchiver / NSKeyedUnarchiver, Core Data, and a range of third-party frameworks. NSKeyedArchiver is a popular choice for projects that require more than the basic key-value storage . . .