8. Preloading Data

Never memorize something you can look up.

Albert Einstein

Chapter 7, “Picker Views,” focused on configuring user interface elements backed by Core Data objects. As a result, the main functionality of Groceries is now in place. This chapter dives back into the data model as preloading default data is explained and demonstrated. There are several approaches to providing default data to an application. In some cases, it makes sense to just import data directly in code, as you experienced in previous chapters. A more advanced technique is to generate a persistent store from an XML file. The resulting persistent store can then be shipped with the application and inserted as the initial persistent store before Core Data is set up ...

Get Learning Core Data for iOS with Swift: A Hands-On Guide to Building Core Data Applications, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.