Skip to content

Latest commit

 

History

History
89 lines (73 loc) · 1.66 KB

File metadata and controls

89 lines (73 loc) · 1.66 KB

CocoaPodsTutorial

Let's release CocoaPod!

1. What is CocoaPods?
2. Install CocoaPods
3. Make CocoaPods Project
4. Create own Pod


What is CocoaPods?

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

Install CocoaPods

sudo gem install cocoapods

Make CocoaPods Project

  1. Create a new Xcode project
  2. Initialize Pod in the project directory
pod init
  1. Edit Podfile
platform: [platform], '[version]'

target '[project name]' do

  use_frameworks!

  pod [pod name], ~>[version]

end
  1. Install Pod
pod install
  1. Open Xcode workspace and do your job!

Create own Pod

  1. 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]

  1. Create own files in 'classes' directory
  2. Specify version in .podspec
Pod::Spec.new do |s|
  ...
  s.version = '0.1.0'
  ...
end
  1. Release commit and push
git -a -m '[commit summary]'
git tag 0.1.0
git push origin 0.1.0
  1. Validate Pod(If need, fix errors)
pod spec lint
  1. Register session
pod trunk [email address] '[name]' --description='[decription of session]'
  1. Deploy pod!
pod trunk push [project name].podspec