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
350
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
720
Legco OpenData
siuying
0
130
EverClip - Evernote DEVCUP Meetup 2013 Hong Kong
siuying
0
86
iOS Development with Ruby using RubyMotion
siuying
1
180
Other Decks in Programming
See All in Programming
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
520
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
160
iOSエンジニアから始める visionOS アプリ開発
nao_randd
3
130
Software Architecture
hschwentner
6
2.1k
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.8k
Rails アプリ地図考 Flush Cut
makicamel
1
110
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
270
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
130
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
120
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2.7k
最近のVS Codeで気になるニュース 2025/01
74th
1
260
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
4
1.3k
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Bootstrapping a Software Product
garrettdimon
PRO
306
110k
Building Adaptive Systems
keathley
40
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Raft: Consensus for Rubyists
vanstee
137
6.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
GraphQLとの向き合い方2022年版
quramy
44
13k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
We Have a Design System, Now What?
morganepeng
51
7.4k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
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