Do Core Data Entities Need Primary Keys?

In this video I pop the hood on Core Data’s SQLite persistent store to discover the details about whether or not you need to add a property representing a “primary key” for your Core Data Entities. Take a look and be sure to subscribe for to stay connected to future screen casts! Transcript I had […]

The Case for CloudKit

Jump to… Developing for Apple Platforms Only? Expand Beyond Apple Platforms with CloudKit JS Want Built-in Authentication? CloudKit is Free for Longer Rolling Your Own Backend? Company Requirement: 1st Party Frameworks and Services Only? Personal 3rd Party Risk Aversion? Only Need a Remote Data Store? Keep it Simple. Depend On What Apple Depends On… Tradeoffs […]

Swift Cheat Sheet for iPhone Location Services Access & Usage

This is a cheat sheet of the code and workflow for iPhone location access and usage, from requesting permission to using the location of the user’s device. Jump to… Framework Import Set Location Usage Description in Info.plist Initialize CLLocationManager and Implement CLLocationManagerDelegate Start Location Services, Check Location Authorization Status, Request Permission Alert Location Access Needed […]

Swift Cheat Sheet for iPhone Camera Access & Usage

This is a cheat sheet of the code and workflow for iPhone camera access and usage, from requesting permission to using the photo taken with a user’s device. Jump to… Framework Import Set Camera Usage Description in Info.plist Check and Respond to Camera Authorization Status Request Camera Permission Present Camera Alert Camera Access Needed Use […]

Swift 4 Upgrade Error: ‘init(colorLiteralRed:green:blue:alpha:)’ is unavailable

I upgraded a project to Swift 4 today and hit a compiler error: ‘init(colorLiteralRed:green:blue:alpha:)’ is unavailable: This initializer is only meant to be used by color literals. The fix is pretty simple: Don’t use that initializer! (thank you, Captain Obvious!) The correct initializer to use for specifying a red, green, blue, and alpha to get […]

Local Receipt Validation for iOS in Swift From Start to Finish

Local Receipt Validation for iOS in Swift From Start to Finish

Local receipt validation in Swift doesn’t seem to be widely written about. I’ve been able to find snippets of code scattered across the Internet, but nothing that brought everything together in one spot so that I could wrap my head around the whole process. I’ve been working on some code for a while, and this […]

Finalizing Receipt Validation in Swift – Computing a GUID Hash

The aim of this guide is to help you finalize the receipt validation process by computing the GUID hash for your app, and comparing it to the hash that’s stored within your receipt itself. This is a continuation of my receipt validation series. I’m assuming that… You’ve prepared to test receipt validation by setting up […]

Receipt Validation – Parse and Decode a Receipt with Swift

The aim of this guide is to help you parse a receipt and decode it so that you have readable pieces of metadata to inspect and finalize all of the receipt validation steps. This is a continuation of my receipt validation series. I’m assuming that… You’ve prepared to test receipt validation by setting up your […]

Receipt Validation – Verifying a Receipt Signature in Swift

You’ve prepared to test receipt validation by setting up your app in iTunes Connect. You’ve brought in a cryptography library like OpenSSL to be able to work with the PKCS #7 container that acts as the “envelope” for the receipt. Perhaps you’ve even done it the “easy way” with CocoaPods. You’ve located and loaded the […]

Using an Existing SQLite Store with NSPersistentContainer

If you’ve been creating the Core Data Stack without NSPersistentContainer and you’re thinking about switching things up to use NSPersistentContainer, you need to think about your existing SQLite persistent store. Creating the stack with NSPersistentContainer handles the creation of SQLite stores internally, so brand new setups using NSPersistentContainer are pretty easy. But how do you […]