
Review the overview and FAQ for the SwiftUI series on core data in SwiftUI, with downloadable starter and final resources and a Q&A section, and video resolution tips.
Explore inspecting core data in the Chordata app development using a magnifier tool and simulator to view category and item entities, their relationships, and primary keys.
Kick off a SwiftUI and Core Data project by building a category and item app, including an alert with a text field, navigation between views, and persistent data storage.
Create a SwiftUI reminder app using Core Data, define the Reminder model with Item and Category entities, and configure a persistent controller to load and save data.
Build a reminder manager as an observable object in swiftui, organize the core data model and view, and load, save, and delete categories to drive the UI.
Create a category list view in SwiftUI, wiring a reminder manager as an environment object, and implement a category alert with a text field and binding to Core Data persistence.
Model the core data relationship between category and item in SwiftUI, define attributes, and implement identifiable protocol and fetch requests with predicates and sort descriptors to load and save items.
Build a SwiftUI item list view driven by a category, using a reminder manager as an environment object to display, load on appear, add, and remove items.
Create a SwiftUI item cell and view model to add, save, and delete items, manage categories, and reflect completion with a circle indicator, using a reminder manager.
Tackle core data challenges in the reminder project: display item counts per category and toggle completed items to hide or show them with the Chordata backend.
Learn how the nullify deletion rule affects related objects when deleting a category in core data, showing orphan items and the need for safeguards.
Configure cascade delete in Core Data for the category-to-item relationship in a SwiftUI app, then observe that deleting a category removes its related items such as football and biking.
Enforce a denied deletion rule in a SwiftUI Core Data app by guarding category deletion with relationship checks, displaying alerts when items exist, and guiding users to delete items first.
Create a project without Xcode, manually add the persistent controller and data model to build a movie library with DVD and blu ray sections and ratings via NSW result controller.
Build a movie library app by adding core data to an Xcode project, define a movie entity with id, name, format, rating, and image, and implement a persistence manager.
Learn to decode json into an NSManagedObject by implementing Decodable, using a coding user info key extension to pass the context, and populating name, rating, image, and format.
Build a movie manager as an observable object using a fetched results controller to fetch and publish movies in SwiftUI with an environment object.
Create a SwiftUI movie list with a rating view that displays five stars in yellow or black and updates on taps, organized by format with image loading from data.
Implement delegate to enable live, automatic updates of movie ratings in a SwiftUI Core Data app, then add a reset button to zero all ratings.
Learn to implement a batch update to reset movie ratings in core data, building and executing the update request with the context, and validate the updated records.
Explore a performance approach to sectioned data by switching from a string array to a dictionary of section names mapped to movies, eliminating filtering and enabling order with sorted keys.
Build the Home Report app with Core Data inheritance for condo and single-family homes, enabling complex searches, sales aggregations, and filters by location and type.
Build a Core Data model for a home report in SwiftUI by defining home, condo, and single-family entities with a sale history, including id, city, price, image, and inheritance relationships.
Explain Decodable for object inheritance to map json into core data objects in a SwiftUI model, including home types, categories, status, sale history, and context.
Learn to implement a home data entity extension in Core Data with SwiftUI that loads homes, filters by is for sale, and updates list via a fetch request and sorting.
Learn how to query sale history by using the home relationship as a predicate, fetch and sort by date (most recent first), and display results in SwiftUI with Core Data.
The lecture teaches implementing filter and sort in Core Data with compound predicate, building status and home type predicates, applying sort descriptors, and wiring UI controls for filtering and sorting.
Learn to use sum and count aggregate functions in Core Data within a SwiftUI app to calculate total home sales and condo and single-family sales in currency.
Explore implementing min, max, and average aggregate functions in a SwiftUI Core Data app, calculating condo and single-family sold prices and handling complex predicates.
Build the Foody app to fetch nearby restaurants via a supplemental API, save favorites, and manage data with a Core Data model and persistent container.
Create a Core Data model named foodie with restaurant and store location entities, use a transformable location attribute with a custom location transformer, and implement a cascade delete relationship.
Parse the zomato api rest response and decode it into restaurant and location models using the decoder protocol, then update the restaurant list on the main thread.
Explore updating a SwiftUI list and cell views from API responses by managing store locations, selecting restaurants, displaying navigation to details, and preparing save and delete functions.
Create a new list name in the manager and save a non-empty, selected restaurant list using the main context, with guard checks and notes on performance.
Demonstrates safe core data handling with a new background context, recreating the selected restaurant and store location via entity descriptions, and saving on the main thread.
Learn the drawbacks of using Xcode's class definition generation for Core Data in SwiftUI, including issues with non-optional properties and lost ability to implement custom logic in the class.
Explore generating movie object classes with the category extension in SwiftUI Core Data, compare category extension with classic generation, and troubleshoot non-optional name properties and build failures.
Demonstrate data migration and positioning in a winter resort app by creating, editing, and displaying ski or snowboard students across beginner to black levels, with color coding.
Master lightweight migration in Core Data for SwiftUI by creating a new data model version, adding an instructor attribute to the student entity, and validating input.
Learn a Core Data migration workflow by creating a new data model version, adding instructor and lesson entities, and mapping data from the old student model to the new structure.
Consume the updated data model in SwiftUI by linking student, lesson, and instructor entities and adding parent name and phone fields. Validate migration by creating a new student in simulator.
Sync core data across devices with Clubcard by creating and syncing categories and items between simulators. Observe iCloud testing limits and preview future iCloud functionality.
Enable cloud sync for a SwiftUI Core Data app with CloudKit and iCloud via Clubcard; configure iCloud container, background notifications, and merged view context to sync data across devices.
SwiftUI Series - Core Data in SwiftUI
This course was created and updated for Core Data with SwiftUI. If your project is dealing with Core Data in Swift with ViewController approach, or you intend to learn the previous version, my other course CoreData for Swift Development is the course you want.
I am new to SwiftUI, is this the right course for me?
Although prior SwiftUI experience is not required, it is recommended. If you are new to SwiftUI, it would be helpful to learn some fundamental in SwiftUI development. Udemy has lots of SwiftUI course. You may also check my SwiftUI course SwiftUI Series - SwiftUI Fundamentals to get yourself up-to-speed with SwiftUI development.
What is Core Data? Why should I know about Core Data?
Core Data is one of the most powerful framework that Apple has provided for developer. "Core Data is a framework that you use to manage the model layer objects in your application. It provides generalized and automated solutions to common tasks associated with object life cycle and object graph management, including persistence." - Source from Apple".
If you are passionate about learning mobile development with SwiftUI and looking to take your iOS development skills to the next level, Core Data framework should be at the top of your list.
What's in it for me?
In this course I will take you on a journey in the world of Core Data. We will cover all the important aspects of Core Data:
Entity
Entity Inheritance
Attribute Type
Relationships
ManagedObjectContext
ManagedObject
PersistentContainer
JSON parsing with Codable to NSManagedObject
Predicate
CompoundPredicate
Fetching
Batch Fetching and Update
Object Deletion
Asynchronous Fetching
NSFetchedResultsController
Aggregate Functions
Grouping
Caching
Data Model Versioning
Automatic Lightweight Migration
Manual Migration with Model Mapping
Background process
Automatic Subclass and Class Extension Generation
CloudKit Integration
Throughout this course we will look in detail the Core Data framework to provide data storage functionality in iOS applications. We will start by creating a simple app that is utilizing Core Data framework, building our own Persistence Container and eventually using all different Core Data features into our application.
Along with Core Data versioning, migration and iCloud integration, I will take you on developing 5 iOS applications and how we can integrate all of these components into Core Data.
Some notable updates from the previous version of Core Data course:
JSON Parsing with Codable .. bye bye Dictionary Mapping!!
We will look into several different techniques to parse JSON response (from sample and live API call) and transform them using Codable protocol directly into Core Data NSManagedObject. No more using dictionary mapping to build our Core Data object. We will cover this for simple Core Data Entities all the way to Entities with inheritance.
CloudKit
In one of the projects, we will demonstrate how to integrate the CloudKit into our app and to sync our data across multiple devices. Apple has done a wonderful job to make this process simple. We will also discuss some caveats so you will have an informed decision when integrating CloudKit to your project.
Predicate using KeyPath
In building our predicates, we will be using KeyPath approach to avoid any potential typo when creating the predicate arguments. It will map directly to object property using the dot notation.
All SwiftUI
All views, models and services class are built for SwiftUI. Along the way, you will also learn the SwiftUI development techniques in building Core Data applications.
Do at your own pace
Lots of students have different methods of learning. Through out this course I will provide both the starter and final Xcode project solution, so you can either follow along one step at a time or you can jump directly to the final solution. By the time you are done with SwiftUI Series - Core Data in SwiftUI course, you will be ready and very confident to take on any Core Data project coming your way. On top of that, you will be one step closer to become a well rounded iOS developer.
Target Audience: All iOS developer that would like to take their skills to the next level.
What are the requirements?
A Mac laptop or iMac
Xcode
Some knowledge of SwiftUI development would be helpful