- Open your iOS project.
- Choose File > New > Target… from the menu bar.
- Click Framework & Library in the OS X section.
- Choose the Cocoa Library target.
- Enter a name for the OS X version of the library. It must be different than the iOS library name. Example: “MyLibraryOSX”.
- Maybe change the type to Static.
- Click Finish.
- Select your project itself in the Project Navigator.
- Click on the new OS X library target in the TARGETS section.
- Click on the Build Phases tab.
- Open the Compile Sources section.
- Note that Xcode automatically created a
.m
file with the same name as the OS X library target. You may wish to delete this from your project. - Add your library sources to the Compile Sources section.
Xcode normally creates a scheme for the new target automatically. If you have turned “Autocreate schemes” off for this project, you need to choose Product > Manage Schemes… and create (or ask Xcode to autocreate) the scheme for the new target.