O'Reilly logo

Core Data in Swift by Marcus S. Zarra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sharing the Data Model

Since we’ve already developed our application for iOS, we want to leverage as much of that knowledge as possible. With Core Data, that leveraging is extensive. The xcdatamodel file structure is identical between Mac OS X and iOS. This means we can use the same data model we’ve been using on iOS. Further, since the data model can be shared and reused, we can share and reuse the data objects as well.

As of this writing, Xcode constructs projects so that the .xcodeproj file is above all of the other files needed in the project. The purpose behind this setup is so we can more easily structure our projects to share components between iOS and Mac OS X. Therefore, we start our desktop project by creating a new project named Desktop. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required