6 On the Mac, you can use Frameworks. But they aren’t allowed on iOS, so use Static Libraries to reuse code. You can share between iOS and Mac versions of the same app or share between different apps.
Separate your concerns and keep them separate. Different targets and class prefixes can enforce your architecture. MVC is a fine place to start, but for more complex projects, additional layers can be helpful.
code is written to be reusable between different apps, then it won’t rely on app-specific information. This will make it more testable. Example: splitting out the concept of a library in a Core Data app
9 This is like designing code by writing the tests for it: designing for reusability informs your design decisions. Example: splitting out the concept of a library in a Core Data app
subdirectory • Create a workspace in the top directory • Add the app project to the workspace • Add a project for the static library (iOS > Framework & Library > Cocoa Touch Static Library) in the new workspace • Link the library into your project • Set up Public Headers Folder Path for the library: public/LibraryName • Set up the Header Search Paths for the app: $(CONFIGURATION_BUILD_DIR)/public • Add the library to the Build phase of the scheme • Test by importing a header • Add any non-source resources to the app project • Add -ObjC to “Other Linker Flags” for the library if you want to use ObjC categories