Let's release CocoaPod!
1. What is CocoaPods?
2. Install CocoaPods
3. Make CocoaPods Project
4. Create own Pod
CocoaPods is a library dependency manager of Xcode project. CocoaPods helps to easily discover 3rd-party opensource libraries.
Why do we need dependency manager? https://en.wikipedia.org/wiki/Dependency_hell
sudo gem install cocoapods
- Create a new Xcode project
- Initialize Pod in the project directory
pod init
- Edit Podfile
platform: [platform], '[version]'
target '[project name]' do
use_frameworks!
pod [pod name], ~>[version]
end
- Install Pod
pod install
- Open Xcode workspace and do your job!
- Create Xcode Pod project
pod lib create [pod name]
1-1 Choose Platform [iOS/macOS]
1-2 Choose Language [Swift/ObjC]
1-3 Include Demo Application [Y/N]
1-4 Testing Framework [Quick/None]
1-5 View Based Testing [Y/N]
- Create own files in 'classes' directory
- Specify version in .podspec
Pod::Spec.new do |s|
...
s.version = '0.1.0'
...
end
- Release commit and push
git -a -m '[commit summary]'
git tag 0.1.0
git push origin 0.1.0
- Validate Pod(If need, fix errors)
pod spec lint
- Register session
pod trunk [email address] '[name]' --description='[decription of session]'
- Deploy pod!
pod trunk push [project name].podspec