CoreData in Swift 3 and iOS 10
4.1 (134 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
810 students enrolled
Wishlisted Wishlist

Please confirm that you want to add CoreData in Swift 3 and iOS 10 to your Wishlist.

Add to Wishlist

CoreData in Swift 3 and iOS 10

Unleash the power of Core Data on your iOS 10 application using Swift 3 and Xcode 8
4.1 (134 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
810 students enrolled
Created by Andi Setiyadi
Last updated 3/2017
English
Current price: $50 Original price: $95 Discount: 47% off
30-Day Money-Back Guarantee
Includes:
  • 8 hours on-demand video
  • 26 Articles
  • 54 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Understand the new features of Core Data in iOS 10 and Xcode 8
  • Know how to navigate in Xcode 8 to work in Core Data related projects
  • Understand how Core Data data model and persistence work
  • Utilize fetching strategy on the application
  • Know how to migrate from current data model to the new data model to adapt the business growth opportunity
  • Analyze Core Data performance
  • Apply best practices in implementing Core Data in iOS application
View Curriculum
Requirements
  • Mac OS
  • Xcode 8
Description

iOS Core Data in Swift 3 and iOS 10

==============================================

***** Created with Xcode 8 and Swift 3 *****

Published: September 2016

==============================================

This course was created for Core Data using Xcode 8 with Swift 3.  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, which was created using Xcode 7 and Swift 2.2.

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 Core Data in Swift 3 and iOS 10 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 in Swift 3 and iOS 10 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 8
  • Some knowledge of Swift development
Who is the target audience?
  • This course is meant for iOS developer who knows the basic of Swift development and would like to learn Core Data framework.
  • All iOS developer should know about CoreData. It is one of the most powerful framework provided by Apple.
Curriculum For This Course
Expand All 61 Lectures Collapse All 61 Lectures 08:15:27
+
WELCOME TO THE COURSE
2 Lectures 05:38

We will look into the course description, set the expectation and goal

Preview 02:33

Common questions raised related to the course and where to get information.

Frequently Asked Question
03:05
+
A TASTE OF CORE DATA
6 Lectures 33:45

We will build our first single view application that will layout the foundation for the introduction to Core Data. The app will be created with built-in Core Data stack integrated with it and ready for implementation.

Grocery List
14:34

Xcode Change in Behavior
00:51

We will start creating our first entity in Core Data and use the KVC (key-value-coding) approach in accessing our Core Data entity/attributes.  By the end of this lecture, students will be able to create Core Data application by storing and retrieving the data using key - value approach.

Core Data with Key Value Coding
12:16

Solution source codes for Core Data with Key Value Coding

Core Data with Key Value Coding (Xcode Project - Solution)
00:01

This is the first of many major steps in Core Data. In this lecture students will start subclassing the Entities from the data model to create Swift objects to represent the entities. This allows Xcode to provide code completion using dot notation to access our objects instead of using key - value approach.

We will learn for the first time to use Swift 3 and new Core Data syntax and the new Persistent Container.

Creating ManagedObject Subclass
06:01

Solution source codes for Creating ManagedObject Subclass.

Creating ManagedObject Subclass (Xcode Project - Solution)
00:02
+
LET'S GET WET
23 Lectures 03:43:37

We will review the concept of new Core Data stack in iOS 10.

Core Data Stack Explained
02:30

We will review in more detail how the Core Data stack has evolved from iOS 9 to iOS 10.  

In this lecture will cover how to extract Core Data stack out of AppDelegate. Students will create a regular Single View Application without checking the option for Core Data during the project creation, and instead will work toward building the Core Data stack manually as a separate Swift file.

Core Data Stack Implementation
06:49

Solution source codes for Core Data Stack Implementation.

Core Data Stack Implementation (Xcode Project - Solution)
00:01

Some projects may have been created without Core Data and as the projects evolve, there comes a need to utilize Core Data for data persistent.  There is no need to start the project from scratch, we will learn how to 'inject' the Core Data stack into the existing projects.

Setting up Core Data in Existing Project
03:24

This lecture introduces how to set the entities and their attributes in Core Data.  It shows different data types available in Core Data that can be assigned to attributes, such as String, Integer 16, Double, Binary Data. We will learn about: 

  • Creating Parent - Child entity to allow object inheritance
  • Setting up entity relationships: one-to-one and one-to-many relationships
  • Observing Core Data using editor and graph/diagram representation
  • Subclassing NSManagedObject
Preview 15:05

Xcode project source codes for Entities, Attributes, Relationship and Object Inheritance

​Entities, Attributes, Relationship and Object Inheritance (Xcode Project)
00:01

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

Handling JSON Data
32:58

Xcode project solution source codes for Handling JSON Data

Handling JSON Data (Xcode Project solution)
00:02

We will check some development tools that will us to actually see the data in the Core Data sqlite backend.

Where is My Data?
06:31

We will learn how to implement a batch delete in dealing with multiple records removal.  This will improve the app performance tremendously in large data sets scenario.

Multiple Records Removal
08:07

Xcode project solution source codes for Multiple Records Removal

Multiple Records Removal (Xcode Project Solution)
00:02

We will learn the fundamental concept of searching records in Core Data using predicate.  We will be using the new Swift 3 and Core Data syntax and functions in iOS 10 to retrieve our data.

In this lecture we start diving in building the request object and using predicate to set the search criteria. We will look into the following topic:

  • Set search criteria using key path condition
  • Execute request object to invoke Core Data store
  • Handle the search results
  • Load data based on on query execution


Records Searching
33:44

Xcode project source codes for Records Searching

Records Searching (Xcode Project Solution)
00:01

We will explore how to handle the request within a one-to-many relationships.

Fetch One-To-Many Records
26:32

Xcode project solution source codes for Fetch One-To-Many Records

Fetch One-To-Many Records (Xcode Project Solution)
00:02

We will be working on filter and sort functions of the Home Report app and how to update the records in table view using protocol-delegate approach based on the sort and filter options selected by end users.

Sort and CompoundPredicate 1
23:47

We are introducing CompoundPredicate to handle multiple criteria when submitting a query to Core Data. We will use CompoundPredicate and SortDescriptor to build the request object.

Sort and CompoundPredicate 2
11:14

Xcode project source codes for Sort and CompoundPredicate

Sort and CompoundPredicate (Xcode Project Solution)
00:01

This lecture shows how to utilize Core Data aggregate function "SUM" and "COUNT". It demonstrates the use of DictionaryResultType, CountResultType and CountForFetchRequest. It also shows how to build the expression description into the request object to execute Core Data aggregate functions.

Agregate Function 1
22:30

On this second part of Aggregate function lectures, we will look into using Core Data MIN, MAX and AVERAGE aggregate functions.

Aggregate Function 2
21:49

Aggregate Function (Xcode Project Solution)
00:01

This lecture introduces asynchronous fetching in Core Data using NSAsynchronousFetchRequest and how to handle the response in completion handler.

Asynchronous Request
08:23

Xcode project source codes for Asynchronous Request

Asynchronous Request (Xcode Project Solution)
00:01
+
AUTOMATIC SUBCLASS GENERATION
4 Lectures 21:28

One of the newest features of Core Data in iOS 10 is to automatically generate the managed object subclass and we will be exploring on how to set this up in Xcode 8.

Automatic ManagedObject Subclass Generation
04:55

Xcode project source codes for Automatic ManagedObject Subclass Generation.

Automatic ManagedObject Subclass Generation (Xcode Project Solution)
00:01

This is another automatic generation feature in Xcode 8.  The difference with subclass generation, we will only set the automatic generation for the class extension.  We would explore on how and what to generate and what still needs to be created manually.  

Automatic Class Extension Generation
16:30

Xcode project source codes for Automatic Class Extension Generation.

Automatic Class Extension Generation (Xcode Project Solution)
00:01
+
EXPLORING NSFetchedResultsController
8 Lectures 58:44

We will demonstrate how to use NSFetchedResultsController to fetch data from Core Data store. NSFetchedResultsController is created to support tableview in mind so it is a perfect fetching approach when we are using UITableViewController. We will look into more detail why this fetching strategy brings benefit to display and update data in the tableview on the subsequent lectures.

Tableview with NSFetchedResultsController
21:32

Xcode project source codes for Tableview with NSFetchedResultsController.

Tableview with NSFetchedResultsController (Xcode Project Solution)
00:01

This lecture demonstrates how to delete a record from our Core Data data store by utilizing NSFetchedResultsController to perform the object deletion. It shows how effectively NSFetchedResultsController handles the update for tableview datasource without the need to manually reload the data.

Delete a Record
19:05

Xcode project source codes for Delete a Record.

Delete a Record (Xcode Project Solution)
00:01

We will look into updating multiple records with one batch request. One hidden challenge on this lecture is to update the view after the batch update request is executed. To address this, we will look to fault object and how we can get the object out of it and update the state of the object. We will also learn how to prevent the cache data being used instead of the updated object state.

Batch Update
11:41

Xcode project source codes for Batch Update.

Batch Update (Xcode Project Solution)
00:01

This lecture will show how to group and cache the results from Core Data store by leveraging the attributes within NSFetchedResultsController.

Results Grouping and Caching
06:20

Xcode project source codes for Results Grouping and Caching.

Results Grouping and Caching (Xcode Project Solution)
00:01
+
PERFORMANCE TUNING
6 Lectures 48:37

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
15:03

Xcode project source codes for Dealing with Large Images.

Dealing with Large Images (Xcode Project Solution)
00:01

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.

Incremental Fetching
05:25

Xcode project source codes for Incremental Fetching.

Incremental Fetching (Xcode Project Solution)
00:01

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
28:05

Xcode project source codes for Measuring Performance.

Measuring Performance (Xcode Project Solution)
00:01
+
AUTOMATIC LIGHTWEIGHT AND MAPPING MODEL MIGRATION
5 Lectures 57:17

Core Data lightweight migration is the easiest of migrating our data model. We will take advantage of new Core Data feature in iOS 10, automatic lightweight migration.

Automatic Lightweight Migration
10:44

Xcode project source codes for Automatic Lightweight Migration.

Automatic Lightweight Migration (Xcode Project Solution)
00:01

This is the first part of manual migration topic. We are going to refactor our data model entities, attributes and relationships. We will create our new mapping model and learn how to manually map the old entities, attributes and relationships to the new data model.

Data Migration with Mapping Model 1
18:41

This is the second part of manual migration topic. We are going to update our codes to reflect the new data model that we created on the first part.

Data Migration with Mapping Model 2
27:49

Solution source codes for Data Migration with Mapping Model.

Data Migration with Mapping Model (Xcode Project Solution)
00:02
+
MANAGING CONTEXT THREAD
4 Lectures 40:56

We will learn about the new background context provided in the new Core Data

New CoreData Background Process
33:27

Solution source codes for New CoreData Background Process

New CoreData Background Process (Xcode Project Solution)
00:02

We will look into managing the managedObjectContext thread using perform block/andWait  approach.

Managing Thread
07:25

Solution source codes for Managing Thread

Managing Thread (Xcode Project Solution)
00:02
+
WHAT'S NEXT?
2 Lectures 05:24

A walkthrough on how to sign up for Apple Developer Program.

Enroll to Apple Developer Program
04:03

This is not the end of the road. Set your brand new and shiny skills to work on your next Core Data projects.

Next Step
01:21
+
CRUD Sample
1 Lecture 00:01

Grocery List app with CRUD and Sort functionalities using NSFetchedResultsController.

Grocery List - CRUD
00:01
About the Instructor
Andi Setiyadi
4.4 Average rating
275 Reviews
1,545 Students
5 Courses
Senior Web and Mobile Developer

Hi! I am Andi. I have a degree in MS Information Systems and been working for a Fortune Top 25 Company for the last few years.

I am passionate about mobile development and have been using both the hybrid and native approach on my projects. I fell in love with Swift and been part of the early adopter. I truly believe Swift will become one of the development languages of the future.

I live in beautiful state of Colorado in the United States and while I am not busy coding, I enjoy biking and skiing.

My motto is never stop learning and share the knowledge. Having said that, I am ready to take you on the journey of Swift development world and hope you will be a part of it.