Core Data Model Attributes and NSManagedObject Property Types Must Match!

Jump to… Data model Attributes and NSManagedObject property types – Match ’em! Optionals are Types Lessons learned Was this article helpful? Please share! Learning Core Data? Watch my course, Core Data Fundamentals with Swift! I admit – it might have taken me less time to figure out my runtime exception if I hadn’t just migrated […]

How to Unwrap Multiple Optionals with One If-Let in Swift

What do you do when you’ve got two (or more) optionals that you need to safely unwrap and work with? Code examples Suppose that you’ve got two arrays, both of which are optional. What I want to do right now is walk through a couple of scenarios where I unwrap them at the same time […]

Creating the Core Data Stack with Backwards Compatibility in Swift

In 2017, we live in a world where there are still non-iOS 10 devices out in the wild. If your app is targeting an iOS version earlier than iOS 10, or macOS Sierra (10.12), you’ll be unable to take advantage of Core Data’s latest “stack creation” class called NSPersistentContainer. So what can you do? While […]

Core Data Fundamentals with Swift

Core Data is an extremely powerful framework for managing and persisting data on your users’ devices. And let’s face it: saving data to your users’ devices is inevitable. The question is, which data management and persistence technology you use when the time comes for you to tackle this challenge? I’ve been hard at work on […]

Using a Core Data Model in Swift Playgrounds

Did you know that you can tinker with Core Data inside of Swift playgrounds in Xcode? You can! Jeremiah Jessel, author at, wrote up an article in 2015 detailing how you can use the Core Data framework inside a playground. He shows how you can do everything from setting up the Core Data stack, […]

Force Unwrapping Swift Optionals: Code Smell!

Do you find your Swift code riddled with !‘s? I’m becoming more and more uncomfortable with seeing ! throughout my Swift code. It’s just a matter of time before it’s going to bite me. Often, I do it because it’s the “easy thing” to do at the time. But it’s dangerous. Swift optionals are trying […]

Is Protocol Oriented Swift Better than Object Oriented Swift?

A question was asked on Reddit and showed up in my feed as I was browsing this weekend: What does protocol oriented programming mean, and why is it better than OOP? I really like a few things that were said in one of the top “Explain Like I’m 5” comments that was posted in response […]

Extracting a PKCS7 Container for Receipt Validation with Swift

Updated on July 15, 2017 – Swift 3 So 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 […]

Creating Calendar Events with Event Kit and Swift

Folks have asked more about working with Event Kit and Swift, so the series continues with this guide on how to create calendar events with Event Kit and Swift! Previous guides in the series include the following: Previous Guides Beginner’s Guide to Event Kit in Swift – Requesting Permission Creating Calendars with Event Kit and […]

Swift Cheat Sheet for Dates, Formatters, & Date Components

Working with NSDate, NSDateFormatter, and NSDateComponents can be a little convoluted, so I’ve created myself a cheat sheet that will be updated as I discover new tips and tricks in this realm. The new cheat sheet can be found over at GitHub in the form of an Xcode Playground: Resources Swift Dates Cheat Sheet Playground […]