2. Agenda
• What is cocoapods
• Why cocoapods
• comparisions between cocoapods, carthage and git
submodules?
• How to use cocoapods
• use
• develop
• Get your hands dirty!
3. What is cocoapods
• An automatic way to manage dependencies
• Highly configurable
• A shared standard
• A good way to modularise your app
• simple to develop and extend
• A ruby gem!
4. Automatic and configurable
• pod ‘AFNetworking’, ‘~>2.0’
• version policy:
• '>= 0.1’
• '~> 0.1.2’
• http://semver.org/
6. Automatic and configurable
• Various pod sources
• github (open)
• git repo custom (not open sourced)
• pod ‘PiwikTracker’, :git=>, :tag, branch, commit
• local (for dev purpose)
• pod ‘PiwikTracker’, :path =>
8. cocoapods
• Creates or updates a workspace.
• Adds your project to the workspace if needed.
• Adds the CocoaPods static library project to the workspace if needed.
• Adds libPods.a to: targets => build phases => link with libraries.
• Adds the CocoaPods Xcode configuration file to your app’s project.
• Changes your app's target configurations to be based on CocoaPods's.
• Adds a build phase to copy resources from any pods you installed to your app
bundle. i.e. a ‘Script build phase’ after all other build phases with the following:
• Shell: /bin/sh
• Script: ${SRCROOT}/Pods/PodsResources.sh
9. cathage
• Carthage builds framework binaries using
xcodebuild, but leaves the responsibility of
integrating them up to the user.
• Decentralized dependency manager. (GitHub’s
Trending)
• https://github.com/Carthage/Carthage#adding-
frameworks-to-an-application
10. How to use
• Please refer to liying’s ppt.
• And podfile in each projects.
11. How to use
• pod ‘AFNetworking’, ‘~>2.0’
• version policy:
• '>= 0.1’
• '~> 0.1.2’
• http://semver.org/
13. How to use
• Various pod sources
• github (open)
• git repo custom (not open sourced)
• pod ‘PiwikTracker’, :git=>, :tag, branch, commit
• local (for dev purpose)
• pod ‘PiwikTracker’, :path =>
14. Create a pod
• pod spec create
• pod spec file structure
• https://guides.cocoapods.org/making/private-
cocoapods.html
• https://guides.cocoapods.org/making/specs-
and-specs-repo.html