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
390
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Francis Chong
See All by Francis Chong
Migrate to Swift 3
siuying
0
210
Implement beautiful DSL for iOS using Ruby
siuying
2
810
Legco OpenData
siuying
0
140
EverClip - Evernote DEVCUP Meetup 2013 Hong Kong
siuying
0
100
iOS Development with Ruby using RubyMotion
siuying
1
200
Other Decks in Programming
See All in Programming
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
490
源内ハンズオン概要編
hideg
0
160
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
360
Go 1.27 における memory allocation の高速化
andpad
0
150
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
150
What's New in Android 2026
veronikapj
0
260
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
720
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
770
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
320
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
150
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
180
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
370
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
260
sira's awesome portfolio website redesign presentation
elsirapls
0
320
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
930
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
Exploring anti-patterns in Rails
aemeredith
3
460
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
210
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Deep Space Network (abreviated)
tonyrice
0
250
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
460
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