Creating a framework

Since all of our code for data has already been created in our iOS app, it does not make sense to rewrite our code for our iMessages app. We can create what is known as a framework in order to share our data between our iOS and iMessages apps.

Using frameworks along with app extensions allows us to put shared code in one place. That means less code and more efficiency, because you will not need to update code in multiple places when you have to make a change. Let's get started creating our framework:

  1. In the Navigator panel, select the Project navigator and, then, your project again as we did earlier.
  2. Find the Targets area and click on the + button at the bottom of that area.
  3. Under the iOS tab, scroll to the bottom to Framework ...

Get iOS 10 Programming for Beginners 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.