SlideShare a Scribd company logo
CocoaPods
CocoaPods
CocoaPods
• iOS
•
•
•
• gem sources —remove https://rubygems.org/
• gem sources -a https://ruby.taobao.org
• sudo gem install cocoapods
• pod init
• pod search AFNetworking
• `pod "AFNetworking", "~> 2.0” ` Podfile
• pod update / pod update AFNetworking
• *.workspace
• podspec
• pod spec create your_library_name
• specs.git
podfile.lock
•
•
Podfile
• pod 'AFNetworking', '~> 2.5.1’ # pod update <2.6
• pod 'Nimbus/AttributedLabel', '~> 1.2.0’ # subpodspec
• pod ‘AFNetworking’, :git=>”http://github.com/xxx”, commit=“a_sha1_hash”
• pod ‘AFNetworking’, :git=>”http://github.com/xxx”, branch=>“dev”
• pod ‘AFNetworking’, :git=>”http://github.com/xxx”, tag=>“1.6”
• pod ‘AFNetworking’, :path=>”~/Documents/AFNetworking” # datamanager
• pod update / pod install
• http://guides.cocoapods.org/using/the-podfile.html
post_install
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == "Pods-EMToday-AFNetworking"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$
(inherited)', 'AF_APP_EXTENSIONS=1']
end
end
end
end
Specifying pod versions
Besides no version, or a specific one, it is also possible to use logical operators:
• '> 0.1' Any version higher than 0.1
• '>= 0.1' Version 0.1 and any higher version
• '< 0.1' Any version lower than 0.1
• '<= 0.1' Version 0.1 and any lower version
In addition to the logic operators CocoaPods has an optimistic operator ~>:
• '~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and
higher
• '~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher
• '~> 0' Version 0 and higher, this is basically the same as not having it.

More Related Content

PDF
Using Cocoapods
PDF
CocoaPods introduction
PPTX
GIT, RVM, FIRST HEROKU APP
PDF
Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco
KEY
Odin Authenticator
PDF
Taking Spinnaker for a spin @ London DevOps Meetup 36
KEY
Onsg11 iphone
PDF
Manage and Deploy your sites with Drush
Using Cocoapods
CocoaPods introduction
GIT, RVM, FIRST HEROKU APP
Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco
Odin Authenticator
Taking Spinnaker for a spin @ London DevOps Meetup 36
Onsg11 iphone
Manage and Deploy your sites with Drush

What's hot (20)

PDF
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
ODP
Chef training - Day2
ODP
Ansible basics workshop
PDF
Building web framework with Rack
KEY
WebSocket - Nov 2011
PDF
Ansible Crash Course
KEY
CocoaPods
PDF
infra-as-code
ODP
Chef training Day5
PDF
Ansible101
PDF
Chef Fundamentals Training Series Module 2: Workstation Setup
PDF
Ansible Meetup Hamburg / Quickstart
PDF
RUNDECK PRO - example acl policy convention
PDF
Ansible Automation to Rule Them All
KEY
SELF 2011: Deploying Django Application Stacks with Chef
ODP
Chef training - Day3
PDF
Real world Django deployment using Chef
KEY
Open Atrium (DrupalCon Paris 2009, Day 3)
PDF
#OktoCampus - Workshop : An introduction to Ansible
KEY
WebSocketサーバを使ってみよう! Jul 2011
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef training - Day2
Ansible basics workshop
Building web framework with Rack
WebSocket - Nov 2011
Ansible Crash Course
CocoaPods
infra-as-code
Chef training Day5
Ansible101
Chef Fundamentals Training Series Module 2: Workstation Setup
Ansible Meetup Hamburg / Quickstart
RUNDECK PRO - example acl policy convention
Ansible Automation to Rule Them All
SELF 2011: Deploying Django Application Stacks with Chef
Chef training - Day3
Real world Django deployment using Chef
Open Atrium (DrupalCon Paris 2009, Day 3)
#OktoCampus - Workshop : An introduction to Ansible
WebSocketサーバを使ってみよう! Jul 2011
Ad

Viewers also liked (7)

PPT
Why My Horse Doesnt Smile
PPTX
Crisp about motivation
PPTX
Motivation
PDF
Why My Horse Doesnt Listen
PPT
A case study on motivation
PDF
Presentation On Motivation
PPTX
Theories of Motivation
Why My Horse Doesnt Smile
Crisp about motivation
Motivation
Why My Horse Doesnt Listen
A case study on motivation
Presentation On Motivation
Theories of Motivation
Ad

Similar to CocoaPods Basic Usage (20)

PDF
Денис Лебедев-Управление зависимостями с помощью CocoaPods
PDF
Cocoapods in action
KEY
Practical introduction to dev ops with chef
PDF
CocoaHeads Rennes #13 : CocoaPods
PDF
Velocity 2011 Chef OpenStack Workshop
PPTX
CocoaPods.pptx
PDF
Deploying to Ubuntu on Linode
PPTX
Rhodes mobile Framework
PDF
Kubeflow Development Environment
PDF
Mastering composer
PDF
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
PDF
SydJS.com
PDF
Hacking on WildFly 9
PDF
Giving back with GitHub - Putting the Open Source back in iOS
PDF
State of search | drupalcamp ghent
PDF
Cocoa pods iOSDevUK 14 talk: managing your libraries
KEY
nodecalgary1
PPTX
Private pod support using cocoa pods in ios
PPTX
Using GitHub Actions to Deploy your Workloads to Azure
PDF
For mobile 3/14'
Денис Лебедев-Управление зависимостями с помощью CocoaPods
Cocoapods in action
Practical introduction to dev ops with chef
CocoaHeads Rennes #13 : CocoaPods
Velocity 2011 Chef OpenStack Workshop
CocoaPods.pptx
Deploying to Ubuntu on Linode
Rhodes mobile Framework
Kubeflow Development Environment
Mastering composer
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
SydJS.com
Hacking on WildFly 9
Giving back with GitHub - Putting the Open Source back in iOS
State of search | drupalcamp ghent
Cocoa pods iOSDevUK 14 talk: managing your libraries
nodecalgary1
Private pod support using cocoa pods in ios
Using GitHub Actions to Deploy your Workloads to Azure
For mobile 3/14'

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT
introduction to datamining and warehousing
PPT
Project quality management in manufacturing
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Construction Project Organization Group 2.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
DOCX
573137875-Attendance-Management-System-original
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Geodesy 1.pptx...............................................
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Current and future trends in Computer Vision.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
composite construction of structures.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
web development for engineering and engineering
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
UNIT 4 Total Quality Management .pptx
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
introduction to datamining and warehousing
Project quality management in manufacturing
R24 SURVEYING LAB MANUAL for civil enggi
Construction Project Organization Group 2.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
573137875-Attendance-Management-System-original
Mechanical Engineering MATERIALS Selection
Geodesy 1.pptx...............................................
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Current and future trends in Computer Vision.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
composite construction of structures.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
web development for engineering and engineering
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
UNIT 4 Total Quality Management .pptx
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...

CocoaPods Basic Usage

  • 3. • gem sources —remove https://rubygems.org/ • gem sources -a https://ruby.taobao.org • sudo gem install cocoapods
  • 4. • pod init • pod search AFNetworking • `pod "AFNetworking", "~> 2.0” ` Podfile • pod update / pod update AFNetworking • *.workspace
  • 5. • podspec • pod spec create your_library_name • specs.git
  • 7. Podfile • pod 'AFNetworking', '~> 2.5.1’ # pod update <2.6 • pod 'Nimbus/AttributedLabel', '~> 1.2.0’ # subpodspec • pod ‘AFNetworking’, :git=>”http://github.com/xxx”, commit=“a_sha1_hash” • pod ‘AFNetworking’, :git=>”http://github.com/xxx”, branch=>“dev” • pod ‘AFNetworking’, :git=>”http://github.com/xxx”, tag=>“1.6” • pod ‘AFNetworking’, :path=>”~/Documents/AFNetworking” # datamanager • pod update / pod install • http://guides.cocoapods.org/using/the-podfile.html
  • 8. post_install post_install do |installer_representation| installer_representation.project.targets.each do |target| if target.name == "Pods-EMToday-AFNetworking" target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$ (inherited)', 'AF_APP_EXTENSIONS=1'] end end end end
  • 9. Specifying pod versions Besides no version, or a specific one, it is also possible to use logical operators: • '> 0.1' Any version higher than 0.1 • '>= 0.1' Version 0.1 and any higher version • '< 0.1' Any version lower than 0.1 • '<= 0.1' Version 0.1 and any lower version In addition to the logic operators CocoaPods has an optimistic operator ~>: • '~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher • '~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher • '~> 0' Version 0 and higher, this is basically the same as not having it.