Skip to content

Instantly share code, notes, and snippets.

@ccarrasc
Created August 13, 2018 13:13
Show Gist options
  • Save ccarrasc/05112e1f458d4de2143c262ede490c08 to your computer and use it in GitHub Desktop.
Save ccarrasc/05112e1f458d4de2143c262ede490c08 to your computer and use it in GitHub Desktop.
Scaffold and iOS lib project using Carthage
  1. Create a Cartfile with needed dependencies
  2. Create a Cartfile.private with internal/test dependencies carthage update
  3. Launch Xcode and create a new workspace: FileNewWorkspace
  4. Create a Library project: FileNewProjectCocoa Touch Framework Be sure to add it to the recently created Workspace and group to the Workspace
  5. Create an App project: FileNewProjectSingle View App
    1. Add it to the recently created Workspace and group to the Workspace
  6. Enable your library project to provide a shared schema: (Target selector) → Manage Schemas…
  7. Link the Library project to the App project: (Select App project → Target) → GeneralLinked Frameworks and Libraries
  8. Set the Framework Search Path for both projects to contain: $(SRCROOT)/../Carthage/Build/iOS (non-recursive)
  9. Add the dependencies fetched by Carthage to the build targets:
    1. Select the Library's test target → Build PhasesLink Binary With Libraries → (add frameworks from Carthage/Build/iOS/)
    2. Add a Copy Files Phase to copy the added Frameworks to "Frameworks"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment