Forked from @iOSBySheldon. Cleaned up by @insanj.
- Carthage works like Cocoapods, but a little bit simpler.
- When creating a Cocoapods supported framework need a .podspec file to do some config, which is not required by Carthage.
- When using a Cocoapods supported framework, a workspace file will be automatically created, the umbrella header will be setup in a pod project inside workspace. It feels simple, but the whole process creates a lot files including a "giant" workspace.
- When using a Carthage supported framework, it will just download the framework, and its dependencies if any, to a folder. All we need to do is to drag and drop it to the binary linking section in the project build setting tab, for the first time. It sounds complicated but it makes the project clean.
- Carthage is written in Swift.
- Carthage internally uses
-xcodebuild
to build dependency. - Carthage only supports dynamic frameworks, so iOS 8 and above is required.
- Open Scheme settings and check share scheme in the bottom of the window.
- Note:
carthage build --no-skip-current
can be used to validate
- Git tag with corresponding framework version [Ref 2, 3] $ git tag 1.0 $ git push origin 1.0
- Archive Prebuilt Frameworks into one zip file. If prebuilt frameworks are there already and available to be used, Carthage can use them instead of building from scratch. To offer prebuilt frameworks, the attachment should include .framework and be zipped. Following commands can be used to archive them. [Ref 4] $ carthage build --no-skip-current $ carthage archive YourFrameworkName
- Carthage also can help mitigate by building dynamic frameworks as static frameworks instead. Static frameworks can be linked directly into your application or merged together into a larger dynamic framework with few simple modifications to your workflow, which reduces the pre-main app launch time. [Ref 5]
- Carthage Official Github: https://github.com/Carthage/Carthage#build-static-frameworks-to-speed-up-your-apps-launch-times
- Git Tag Official Doc: https://git-scm.com/book/en/v2/Git-Basics-Tagging
- Git Tag and Push Stack Overflow: https://stackoverflow.com/questions/18216991/create-a-tag-in-github-repository
- Example of Prebuilt Frameworks: https://help.github.com/articles/about-releases/
- Dynamic to Static: https://github.com/Carthage/Carthage/blob/master/Documentation/StaticFrameworks.md
- Use Carthage Supported Framework: https://blog.mat.tc/how-to-make-a-carthage-compatible-framework/
- Use Carthage Supported Framework: https://www.raywenderlich.com/109330/carthage-tutorial-getting-started