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, […]

Sharing a Core Data Model with a Swift Framework

Reviewed on January 28, 2016 – Swift 2.0 Code re-use is a powerful thing, but it’s not always easy to pull off. We strive for it though, because in the long run, it makes maintaining the code far, far easier than if we just settled for copying and pasting. With the introduction of dynamic frameworks […]

Displaying Data With NSFetchedResultsController and Swift

Updated on September 23, 2015 – Swift 2.0 The combination of an NSFetchedResultsController and a UITableView provides a powerful way to integrate Core Data with a user interface. The greatest benefits of using NSFetchedResultsController come when we use it to automatically update a table view when objects are added, updated, or removed from a Core […]

Using Swift to Seed a Core Data Database

Updated on September 23, 2015 – Swift 2.0 Designing an application’s UI can be difficult without actual data to present. Early on in the design process, data sourced from something like an array can suffice. Later on, however, our data sources become more dependent on actual data stores, such as what Core Data provides us. […]

Core Data Cheat Sheet for Swift iOS Developers

Updated on July 27, 2016 – Additional Cheats Having trouble recalling how to perform basic Core Data operations? This cheat sheet is a handy reference to keep you productive with Core Data and Swift! The code snippets below are here to help jog your memory when it’s been a while since you’ve worked in Core […]

Unit Testing Model Layer with Core Data and Swift

Updated on November 19, 2015 – Swift 2.0 As I approached testing my Core Data model, I have to admit I was apprehensive. How in the world was I going to write unit tests for my model layer that depended on a database. Past experience with trying to write tests with databases was painful. I […]

Implement NSManagedObject Subclass in Swift

Updated on July 8, 2016 – Xcode 7 My goal with this blog entry is to help get you set up to create NSManagedObject subclasses in Swift for the Entities in your Core Data model. Jump to… Example Walkthrough Create an Entity Create an NSManagedObject Subclass for that Entity Verify NSManagedObject class in the “Data […]