CoreData for Swift Development (Swift 4.2 & iOS 12)
4.0 (129 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
814 students enrolled

CoreData for Swift Development (Swift 4.2 & iOS 12)

Master the Core Data in Swift 4.2 and iOS 12, and take your iOS development skills to the next level
4.0 (129 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
814 students enrolled
Created by Andi Setiyadi
Last updated 4/2019
English [Auto]
Current price: $34.99 Original price: $49.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 8 hours on-demand video
  • 9 articles
  • 52 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Deep understanding how CoreData data persistent works in iOS
Course content
Expand all 51 lectures 08:13:29
9 lectures 01:36:23
Note for Xcode 10 Storyboarding

On this first app, we are going to build the app from scratch to get the basic idea how to setup a Core Data project from the beginning.  This would be the only time we will be building from a new project.  On subsequent app, you can start following along using a starter project and we will jump right into a Core Data topic.

CoreData Project

We will start laying out the UI for Keystone Park app by storyboarding.

Keystone Park UI

In the first part of CREATE data lecture, we are going to build the service layer that will allow us to enter student and lesson information to Core Data.  We will jump into the concept entity and predicate including how to start querying the Core Data based on the search criteria.

Preview 18:29

We are going start utilizing the service layer to insert new student and lesson record to Core Data.

CREATE New Data 2

We will use search criteria to send request to Core Data and display the data in our tableView. This would be the READ part of the CRUD functionality we are building in this Keystone Park app.

READ Current Data

We will build the service layer to update the existing record.  This would be the UPDATE part of the CRUD functionality.

UPDATE Existing Data

We are exploring the DELETE functionality of the CRUD and learn how to properly delete record within entities relationships.

DELETE Existing Data
+ Useful Tool
1 lecture 03:20

Learn how a third party tool can help you in dealing with Core Data.  It can visualize your data and how entities relationships is set between entities.

+ Deletion Rule
4 lectures 22:02
Section Goal

Learn how entity relationships with NULLIFY deletion rule affects your app behavior.

Rule 1: Nullify

Learn how entity relationships with CASCADE deletion rule affects your app behavior.

Rule 2: Cascade

Learn how entity relationships with DENY deletion rule affects your app behavior.

Rule 3: Deny
+ NSFetchedResultsController
10 lectures 01:24:32
Section Goal

We are going to take a quick look how extract the Core Data boiler plate out of AppDelegate to create a cleaner CoreData stack.

Extract CoreData Boiler Plate
Source Codes

We will look into parsing a json format data and store the extracted information into the Core Data with sqlite backend.

Extract JSON Data

We are going to learn how to fetch data and store the results in NSFetchedResultsController.

Fetching Data with NSFetchedResultsController

We will learn how to populate tableView section and row by utilizing the NSFetchedResultsController coming from the service layer.

TableView Datasource

Learn the strategy on how to properly update a single record and refresh the UI using NSFetchedResultsController to reflect the changes immediately to the users.

Data Update and Refresh

Learn how to run a batch update to modify a set of records and properly refresh the UI.

Batch Update

We will use NSFetchedResultsController to properly handle record deletion in a tableView.

Data Removal

Check this lecture to see how easy doing a grouping of data using NSFetchedResultsController.  We will also explore how to take advantage of data caching which can bring benefits if you are dealing with a large set of data.

Group and Cache
+ Complex Search and Aggregate Functions
10 lectures 02:10:03

We will build a different app on this section, Home Report, that will demonstrate how to perform a more complex search for the Core Data.  

    • Section Overview
      Source Codes

      We will learn how to setup an inheritance relationships for the entities in the data model which will translate to NSManagedObject inheritance setup.

      Entity Inheritance

      We will extract the JSON data and uploading the record to Core Data based on the entity inheritance that we setup in the data model.

      Extract Data for Inheritance

      We are going to create an extension to our NSManagedObject class that will provide a service to our data model during data reading and manipulation.

      Entity Extension

      Explore how we can take advantage of entities relationships in fetching Core Data records.

      Entity Relationships as Predicate

      Learn how to setup multiple predicates and sort that can be used as search criteria.

      Filter and Sort

      We will learn into using multiple predicates and sort mechanism to query the Core Data entities and relationships.

      Compound Predicate and Multi Sort
      Aggregate Function - 1
      Aggregate Function - 2
      + Thread Management
      3 lectures 27:04

      In this section we will demonstrate how managing different managedObjectContexts may affect the performance of your app and provide a better user experience.

      Section Overview

      We will explore the private background context and see how it can provide a better user experience.

      Background Context

      We will look into another alternative of managing the managedObjectContext without using a separate background context.

      Asynchronous Execution
      + CoreData Object Model Generation
      3 lectures 19:47
      Section Goal

      Automatic class generation can simplify your NSManagedObject subclass creation and learn the benefits of having this approach.

      Automatic Generation
      Object Model with Class Extension
      + Performance Tuning
      4 lectures 48:44
      Section Goal

      This lecture will introduce us to Xcode Memory Debugging and Core Data Profiler. We will inspect the application memory footprint and how the different approach of Core Data implementation can impact the performance of our application. We will look into how to efficiently deal with large images and how to use thumbnail when necessary will bring performance impact to the application.

      Dealing with Large Images

      We are going to implement batch size fetching to limit the number of records requested from Core Data store to improve the application performance. It is on demand fetching.

      Fetch Data by Batch Size

      We are going to implement different fetching strategy to improve our application performance. We will be using unit testing to compare the application performance on before and after tuning up our codes.

      Measuring Performance
      + Data Model Versioning and Migration
      4 lectures 56:54
      Section Overview

      We will first look into a simple migration process that will involve a single entity.

      Light Weight Migration

      In this lecture we will learn a more complex data migration that will involve multiple entities and how to migrate existing data from an existing entity into new entities.

      Data Migration with Mapping Model - 1

      We will finish up the complex data migration process by updating the references to previous and new entities.

      Data Migration with Mapping Model - 2
      • Understanding of basic Swift development

      CoreData for iOS Development in Swift

      This course was created and updated for Core Data with the latest Swift 4.x (as of WWDC 2018), targeted for both iOS 12 and 11. We will be using the latest Xcode 10 (Beta) as well as Xcode 9.4 for the course coverage.  

      If your project is dealing with older version of Core Data in iOS 9 or prior, and you intend to learn the previous version, my other course Mastering iOS Core Data with Swift is the course you want.

      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 for iOS and looking to take your iOS development skills to the next level, Core Data framework should be at the top of your list.

      By the time you are done with CoreData for iOS Development in Swift 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.

      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
      • Handling JSON data
      • Predicate
      • CompoundPredicate
      • Fetching
      • Batch Fetching and Update
      • Object Deletion
      • Asynchronous Fetching
      • NSFetchedResultsController
      • Aggregate Functions
      • Grouping
      • Caching
      • Performance Tuning and Best Practices
      • Data Model Versioning
      • Automatic Lightweight Migration
      • Manual Migration with Model Mapping
      • Background process
      • Automatic Subclass and Class Extension Generation

      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 Core Data stack and eventually using all different Core Data features into our application. 

      Performance Tuning and Best Practices

      We will cover the various ways on fetching our data and how to efficiently using Core Data in our app. Unit testing and performance tuning will be an important part on how we can monitor our app performance in conjunction with Core Data in 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.

      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. And by the end of this Core Data for Swift Development course, you should be comfortable and ready to integrate Core Data framework in your application.

      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 Swift development
      Who this course is for:
      • Students who want to learn data persistent in Swift/iOS using CoreData