You are previewing Core Data in Swift.
O'Reilly logo
Core Data in Swift

Book Description

Core Data is intricate, powerful, and necessary. Discover the powerful capabilities integrated into Core Data, and how to use Core Data in your iOS and OS X projects. All examples are current for OS X El Capitan, iOS 9, and the latest release of Core Data. All the code is written in Swift, including numerous examples of how best to integrate Core Data with Apple's newest programming language.

Table of Contents

  1. <span xmlns="" xmlns:epub="" class="toc-secnum">&#160;</span>IntroductionIntroduction
    1. Is This Book for You?
    2. What Is Core Data?
    3. Online Resources
  2. <span xmlns="" xmlns:epub="" class="toc-secnum">1. </span>Before We BeginBefore We Begin
    1. Test Application
    2. The Storyboard
    3. The Recipe List
    4. The Recipe Detail
    5. The Edit Workflow
    6. Ready for Core Data
  3. <span xmlns="" xmlns:epub="" class="toc-secnum">2. </span>Under the HoodUnder the Hood
    1. Introducing the NSManagedObjectModel
    2. Integrating with the NSPersistentStoreCoordinator
    3. Adding the NSManagedObjectContext
    4. Working with NSManagedObject Instances
    5. Building an NSFetchRequest
    6. NSSortDescriptor
    7. Wrapping Up
  4. <span xmlns="" xmlns:epub="" class="toc-secnum">3. </span>iOS: NSFetchedResultsControlleriOS: NSFetchedResultsController
    1. How to Use the NSFetchedResultsController
    2. Under the Hood of the NSFetchedResultsController
    3. Building Our Own: MSZContextWatcher
    4. Wrapping Up
  5. <span xmlns="" xmlns:epub="" class="toc-secnum">4. </span>Versioning and MigrationVersioning and Migration
    1. Some Maintenance Before We Migrate
    2. A Simple Migration
    3. The Difference Between Light and Heavy Migrations
    4. A Heavy/Manual Migration
    5. Fundamentals of Core Data Versioning
    6. Wrapping Up
  6. <span xmlns="" xmlns:epub="" class="toc-secnum">5. </span>Performance TuningPerformance Tuning
    1. Persistent Store Types
    2. Optimizing Your Data Model
    3. Fetching
    4. Faulting
    5. Access Patterns
    6. Wrapping Up
  7. <span xmlns="" xmlns:epub="" class="toc-secnum">6. </span>ThreadingThreading
    1. Threading and Core Data
    2. Working on the Main Queue
    3. Working off the Main Queue
    4. Interqueue Communication
    5. Parent/Child NSManagedObjectContext Design
    6. Export Operation
    7. Import Operation
    8. Asynchronous Saving
    9. Debug Concurrency Checking
    10. Wrapping Up
  8. <span xmlns="" xmlns:epub="" class="toc-secnum">7. </span>Bulk ChangesBulk Changes
    1. Running with Scissors
    2. Doing Bulk Updates
    3. Notifying the Application of Changes
    4. Bulk Deletes
    5. Things to Consider When Using the Bulk Change APIs
    6. Wrapping Up
  9. <span xmlns="" xmlns:epub="" class="toc-secnum">8. </span>Network OperationsNetwork Operations
    1. The Problem and the Approach
    2. The Solution
    3. Accessing the Network Operations
    4. Wrapping Up
  10. <span xmlns="" xmlns:epub="" class="toc-secnum">9. </span>Using Core Data with iCloudUsing Core Data with iCloud
    1. Introducing the UIManagedDocument
    2. Direct NSManagedObjectContext to iCloud
    3. Consuming Changes from iCloud
    4. Under the Hood
    5. Migrating an Existing Application
    6. Desktop iCloud Integration
    7. Issues with Data Quantities
    8. Sharing Data Between iOS and OS X
    9. Wrapping Up
  11. <span xmlns="" xmlns:epub="" class="toc-secnum">10. </span>Adding a Desktop FoundationAdding a Desktop Foundation
    1. Our Application
    2. Our Application Design
    3. Sharing the Data Model
    4. Building the Controller Layer
    5. Building the User Interface
    6. Adding a Splash of Code
    7. Wrapping Up
  12. <span xmlns="" xmlns:epub="" class="toc-secnum">11. </span>Bindings, KVC, and KVOBindings, KVC, and KVO
    1. Key Value Coding
    2. Key Value Observing
    3. Cocoa Bindings and Core Data
    4. Other Interface Elements That Use KVO, KVC, and Core Data
    5. Wrapping Up
  13. <span xmlns="" xmlns:epub="" class="toc-secnum">12. </span>Spotlight, Quick Look, and Core DataSpotlight, Quick Look, and Core Data
    1. Integrating with Spotlight
    2. Integrating with Quick Look
    3. Putting It All Together
    4. Wrapping Up