


We’ll be creating two Xcode projects during this walkthrough: One will be the framework and will be called “CarKit”. The app will target car enthusiasts everywhere – we will empower car fanatics to manage of a list of their favorite cars. The only difference between the apps will be the target platform. Our team is building an iOS app and a Mac app and the underlying data model will be exactly the same between them. Our working example for this walkthrough will be the following: Whatever the case may be, wouldn’t it be awesome to design the Core Data model once and share it between your projects? Maybe you’re building several iOS apps that have different user interfaces but share some underlying persistence-layer models. Perhaps you’re working on an iOS + Mac app combination and the data model for each is identical.

IOS SWIFT SHARE CODE
Not only can we share code between projects, we can also share Core Data models between projects by utilizing frameworks! With the introduction of dynamic frameworks in iOS 8, a world of possibility opened up for iOS developers to achieve some pretty cool re-use scenarios, one of which we’re going to dive into today. We strive for it though, because in the long run, it makes maintaining the code far, far easier than if we just settled for copying and pasting. Code re-use is a powerful thing, but it’s not always easy to pull off.
