Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CocoaPods - A better way to use and publish ope...
Search
Francis Chong
March 29, 2014
Programming
2
370
CocoaPods - A better way to use and publish open source project for Objective-C
At Hong Kong Open Source Conference 2014
Francis Chong
March 29, 2014
Tweet
Share
More Decks by Francis Chong
See All by Francis Chong
Migrate to Swift 3
siuying
0
200
Implement beautiful DSL for iOS using Ruby
siuying
2
760
Legco OpenData
siuying
0
140
EverClip - Evernote DEVCUP Meetup 2013 Hong Kong
siuying
0
92
iOS Development with Ruby using RubyMotion
siuying
1
180
Other Decks in Programming
See All in Programming
マンガアプリViewerの大画面対応を考える
kk__777
0
260
Claude Agent SDK を使ってみよう
hyshu
0
1.4k
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
130
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
2
380
Ktorで簡単AIアプリケーション
tsukakei
0
110
モテるデスク環境
mozumasu
3
1.3k
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
260
Developer Joy - The New Paradigm
hollycummins
1
370
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
250
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
360
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
250
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
Featured
See All Featured
A better future with KSS
kneath
239
18k
The Pragmatic Product Professional
lauravandoore
36
7k
RailsConf 2023
tenderlove
30
1.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
It's Worth the Effort
3n
187
28k
Reflections from 52 weeks, 52 projects
jeffersonlam
353
21k
How to Ace a Technical Interview
jacobian
280
24k
The World Runs on Bad Software
bkeepers
PRO
72
11k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Unsuck your backbone
ammeep
671
58k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Transcript
CocoaPods A better way to use and publish open source
project for Objective-C
Francis Chong @siuying
Cocoa
A cocoa pod http://en.wikipedia.org/wiki/Cocoa_bean
cocoapods.org “CocoaPods is the dependency manager for Objective-C projects.”
Dependency Manager
dependency?
System Frameworks
Reusable Components
Third Party Code
Manage Dependency, the old way
“Drag the *.h and *.m file to Xcode”
None
Static Library
Frameworks
None
“dependency hell”
A -> C (version 1) B -> C (version 2)
A -> C (version 1) B -> C (version 2)
C -> D (version 3) E -> D (version 4) F -> B (version 5)
Better way to manage dependency?
rubygems pip npm
CocoaPods Basic
Installation
sudo gem install cocoapods
pod setup
Project Setup
cd MyApp! pod init
Podfile
None
“The Podfile is a specification that describes the dependencies of
the targets of one or more Xcode projects.” cocoapods.org
DSL for dependencies
None
None
None
None
None
Podspecs
“A Podspec, or Spec, describes a version of a Pod
library.” cocoapods.org
None
None
None
None
Repo
“The Specs Repo is git repository that contains the list
of available pods.” cocoapods.org
None
“Every library has an individual folder, which contains sub folders
of the available versions of that pod. ”
None
Install Dependencies
pod install
None
What happened when you run pod install ?
Update Podspecs Repo
Resolve Dependency
None
Semantic Versioning http://semver.org/
1.6.4 MAJOR.MINOR.PATCH
MAJOR - incompatible API changes
MINOR - add functionality in a backwards-compatible manner
PATCH - backwards- compatible bug fixes.
1.6.4 MAJOR.MINOR.PATCH
Download Dependencies
git hg svn bzr http
Generate Pods project
Generate workspace
None
Advance Topics
Making a CocoaPod
pod spec create MyLibrary
MyLibrary.podspec
None
pod lib create MyLibrary
!"" Assets! !"" Classes! #"" ios! #"" osx! !"" Resources!
!"" Example! #"" Podfile! !"" CHANGELOG.md! !"" LICENSE! !"" README.md! #"" MyLibrary.podspec!
MyLibrary.podspec
README.md CHANGELOG.md LICENSE
Example/Podfile
None
Release Pod
None
Publish your pod to public Repo
Fork the CocoaPods/ Specs repo
.! !"" Specs! #"" [SPEC_NAME]! #"" [VERSION]! #"" [SPEC_NAME].podspec
.! !"" MyLibrary! #"" 0.1.0! #"" MyLibrary.podspec! #"" 0.2.0! #""
MyLibrary.podspec
Send a Pull Request
Your Private Pods
Specify your own Podspec
None
None
Create Your Repo
.! !"" Specs! #"" [SPEC_NAME]! #"" [VERSION]! #"" [SPEC_NAME].podspec
pod repo add REPO_NAME SOURCE_URL!
CocoaPods Today
0.29.0
4227 Pods 12372 Versions
Most merged pull request #2 http://octoverse.github.com/
CocoaPods Bug Bash http://blog.cocoapods.org/CocoaPods-Bug-Bash/
Learn from CocoaPods
Automation
Use existing infrastructure and tools
Build a MVP
Embrace opensource
Francis Chong @siuying
Readings • CocoaPods Guide • Semantic Versioning • iOS Static
Libraries Are, Like, Really Bad, And Stuff • kstenerud/iOS-Universal-Framework