SlideShare a Scribd company logo
1 of 15
Download to read offline
COCOAPODS
What is cocoapods?
CocoaPods is the dependency manager for Cocoa projects written in
either Swift or Objective C. It has thousands of libraries and can
help you scale your projects elegantly.
Presented By Prajwal S
Presentation © by Prajwal S, cosmostack.com
DISCOVERY
CocoaPods was created by Eloy Durán on August 12, 2011.


Taking inspiration from Bundler and RubyGems, CocoaPods was
designed to resolve a list of dependencies, download the required sources,
and configure the existing project in such a way to be able to use them. 

Presentation © by Prajwal S, cosmostack.com
USING COCOAPODS
CocoaPods is easy to get started with both as a consumer and a library
author. It should only take a few minutes to get set up.

Installing CocoaPods:
CocoaPods is installed through RubyGems, the Ruby package manager, which
comes with a standard OS X install.
To install, open Terminal.app and enter the following command:
$ sudo gem install cocoapods

Now you should have the pod command available in the terminal.
Presentation © by Prajwal S, cosmostack.com
MANAGING DEPENDENCIES
A dependency manager resolves a list of software requirements into a list of
specific tags to download and integrate into a project.
Declaring requirements in such a way allows for project setup to be automated, which
is general best practice for software development practice, no matter what the
language. 



Even if you don’t include third-party libraries, CocoaPods is still an invaluable
tool for managing code dependencies across projects.


Podfile
A Podfile is where the dependencies of a project are listed. It is equivalent to Gemfile
for Ruby projects using Bundler, or package.json for JavaScript projects using npm.
To create a Podfile, cd into the directory of your .xcodeproj file and enter the command:
$ pod init
Presentation © by Prajwal S, cosmostack.com
PODFILE STRUCTURE
The Sample Podfile looks like, with specifying all dependency library for the project
Once all of the dependencies have been specified, they can be installed with:
$ pod install


When this is run, CocoaPods will recursively analyze the dependencies of each project,
resolving them into a dependency graph, and serializing into a Podfile.lock file.
Presentation © by Prajwal S, cosmostack.com
SEMANTIC VERSIONING
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.

Presentation © by Prajwal S, cosmostack.com
FUNCTIONING OF PODS
CocoaPods will create a new Xcode project that creates static library
targets for each dependency, and then links them all together into a
libPods.a target. This static library becomes a dependency for your
original application target. An xcworkspace file is created, and should be
used from that point onward. This allows the original xcodeproj file to
remain unchanged.



Maintaining Pods:
Subsequent invocations of pod install will add new pods or remove old
pods according to the locked dependency graph. To update the individual
dependencies of a project to the latest version, do the following:
$ pod update
Presentation © by Prajwal S, cosmostack.com
< Dependant frameworks for libraries
< Pods framework built with all the below libraries compiled
by Pods project linked to our working project.
< Library sources added by cocoapod
< Frameworks built by cocoapods
from dependecy library source added
Presentation © by Prajwal S, cosmostack.com
CREATING A COCOAPOD
Specification:

A .podspec file is the atomic unit of a CocoaPods dependency. It specifies the name, version, license, and
source files for a library, along with other metadata.
Once published to the public specs database, anyone could add it to their
project, specifying their Podfile thusly.

Sample specs:

https://guides.cocoapods.org/making/specs-and-specs-repo.html
NSAlertUtils.podspec
Ruby code:
$ pod spec create
Presentation © by Prajwal S, cosmostack.com
PUBLISHING A COCOAPOD
To get started, you must first register your machine with the Trunk service. This
is easy enough, just specify your email address along with your name.


$ pod trunk register prajwal.s@synchronoss.com “Prajwal S"



Run pod spec lint. This is used to validate specifications. Your podspec should
pass without any errors or warnings.
$ pod spec lint
Now, all it takes to publish your code to CocoaPods is a single command. The
same command works for creating a new library or adding a new version to an
existing one:
$ pod trunk push NAME.podspec
Presentation © by Prajwal S, cosmostack.com
SEARCHING COCOAPODS
Presentation © by Prajwal S, cosmostack.com
PRIVATE PODS
1. Create a Private Spec Repo

To work with your collection of private pods, it is suggest to create own Spec repo. This
should be in a location that is accessible to all who will use the repo.

2. Add your Private Repo to your CocoaPods installation

$ pod repo add REPO_NAME SOURCE_URL
Note: If you plan on creating pods locally, you should have push access to SOURCE_URL
$ cd ~/.cocoapods/repos/REPO_NAME
$ pod repo lint
3. Add your Podspec to your repo

$ pod repo push REPO_NAME SPEC_NAME.podspec


This will run pod spec lint, and take care of all the little details for setting up the
spec in your private repo.
Presentation © by Prajwal S, cosmostack.com
$ pod intall Thankyou
Any Questions?
Some short videos to understand more about cocoapods:
https://www.youtube.com/playlist?list=PLqyi3cdI8X36fjtSmlZRVnvghk9mlbqjC
Presentation © by Prajwal S, cosmostack.com
ONE MORE THING…….
$ pod try Hero
Pod try:
CocoaPods plugin which allows to quickly try the demo project of a Pod.
Presentation © by Prajwal S, cosmostack.com
THANK YOU

More Related Content

What's hot

Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Will Hall
 
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and KubernetesJava Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and KubernetesAntons Kranga
 
Corso su ReactJS
Corso su ReactJSCorso su ReactJS
Corso su ReactJSLinkMe Srl
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Automate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsAutomate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsDaniel Oh
 
How to Build & Deploy a HelloWorld API function using Java on OpenShift in...
How to Build & Deploy a HelloWorld API function using Java on OpenShift in...How to Build & Deploy a HelloWorld API function using Java on OpenShift in...
How to Build & Deploy a HelloWorld API function using Java on OpenShift in...Jan Vosecky
 
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for ClojureLeiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for ClojureJohn Stevenson
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDocker, Inc.
 
Kubernetes Java Operator
Kubernetes Java OperatorKubernetes Java Operator
Kubernetes Java OperatorAnthony Dahanne
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) serverDmitry Lyfar
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationDevelopment Seed
 
DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesTibor Vass
 
Operator Framework Overview
Operator Framework OverviewOperator Framework Overview
Operator Framework OverviewRob Szumski
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveKazuto Kusama
 
Cloud expo-east-2015
Cloud expo-east-2015Cloud expo-east-2015
Cloud expo-east-2015argvader
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDocker, Inc.
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Andrew Bayer
 
Automating stateful applications with kubernetes operators - Openstack Summit...
Automating stateful applications with kubernetes operators - Openstack Summit...Automating stateful applications with kubernetes operators - Openstack Summit...
Automating stateful applications with kubernetes operators - Openstack Summit...Jorge Morales
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 

What's hot (20)

Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers
 
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and KubernetesJava Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
 
Corso su ReactJS
Corso su ReactJSCorso su ReactJS
Corso su ReactJS
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Automate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsAutomate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOps
 
How to Build & Deploy a HelloWorld API function using Java on OpenShift in...
How to Build & Deploy a HelloWorld API function using Java on OpenShift in...How to Build & Deploy a HelloWorld API function using Java on OpenShift in...
How to Build & Deploy a HelloWorld API function using Java on OpenShift in...
 
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for ClojureLeiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
 
Kubernetes Java Operator
Kubernetes Java OperatorKubernetes Java Operator
Kubernetes Java Operator
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best Practices
 
Operator Framework Overview
Operator Framework OverviewOperator Framework Overview
Operator Framework Overview
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
 
Cloud expo-east-2015
Cloud expo-east-2015Cloud expo-east-2015
Cloud expo-east-2015
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 
Automating stateful applications with kubernetes operators - Openstack Summit...
Automating stateful applications with kubernetes operators - Openstack Summit...Automating stateful applications with kubernetes operators - Openstack Summit...
Automating stateful applications with kubernetes operators - Openstack Summit...
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 

Similar to Cocoapods Overview - library dependency manager for iOS

What is CocoaPods and how to setup?
What is CocoaPods and how to setup?What is CocoaPods and how to setup?
What is CocoaPods and how to setup?Milan Panchal
 
Manage your external libraries with CocoaPods
Manage your external libraries with CocoaPodsManage your external libraries with CocoaPods
Manage your external libraries with CocoaPodsJuan C Catalan
 
Create Your First Cocoa pods
Create Your First Cocoa podsCreate Your First Cocoa pods
Create Your First Cocoa podsPawan Ramteke
 
Installing spark scala console in windows 10
Installing spark scala console in windows 10Installing spark scala console in windows 10
Installing spark scala console in windows 10Ankit Kaneri
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSRoss Kukulinski
 
Make your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPodsMake your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPodsitnig
 
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...OCCIware
 
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...Marc Dutoo
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftWan Muzaffar Wan Hashim
 
Shipping to Server and Cloud with Docker
Shipping to Server and Cloud with DockerShipping to Server and Cloud with Docker
Shipping to Server and Cloud with DockerAtlassian
 
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDONSentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDONSaiyam Pathak
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Start your adventure with docker
Start your adventure with dockerStart your adventure with docker
Start your adventure with dockerSagar Dash
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with dockerMichelle Liu
 
How to create a local Android open source project mirror in 6 easy steps
How to create a local Android open source project mirror in 6 easy stepsHow to create a local Android open source project mirror in 6 easy steps
How to create a local Android open source project mirror in 6 easy stepsDeveo
 

Similar to Cocoapods Overview - library dependency manager for iOS (20)

What is CocoaPods and how to setup?
What is CocoaPods and how to setup?What is CocoaPods and how to setup?
What is CocoaPods and how to setup?
 
CocoaPods.pptx
CocoaPods.pptxCocoaPods.pptx
CocoaPods.pptx
 
Private pod support using cocoa pods in ios
Private pod support using cocoa pods in iosPrivate pod support using cocoa pods in ios
Private pod support using cocoa pods in ios
 
Appsody
AppsodyAppsody
Appsody
 
Using Cocoapods
Using CocoapodsUsing Cocoapods
Using Cocoapods
 
Creating Cocoapods Library
Creating Cocoapods LibraryCreating Cocoapods Library
Creating Cocoapods Library
 
Manage your external libraries with CocoaPods
Manage your external libraries with CocoaPodsManage your external libraries with CocoaPods
Manage your external libraries with CocoaPods
 
Create Your First Cocoa pods
Create Your First Cocoa podsCreate Your First Cocoa pods
Create Your First Cocoa pods
 
Installing spark scala console in windows 10
Installing spark scala console in windows 10Installing spark scala console in windows 10
Installing spark scala console in windows 10
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOS
 
Make your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPodsMake your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPods
 
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
 
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in Swift
 
Shipping to Server and Cloud with Docker
Shipping to Server and Cloud with DockerShipping to Server and Cloud with Docker
Shipping to Server and Cloud with Docker
 
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDONSentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Start your adventure with docker
Start your adventure with dockerStart your adventure with docker
Start your adventure with docker
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
How to create a local Android open source project mirror in 6 easy steps
How to create a local Android open source project mirror in 6 easy stepsHow to create a local Android open source project mirror in 6 easy steps
How to create a local Android open source project mirror in 6 easy steps
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Cocoapods Overview - library dependency manager for iOS

  • 1. COCOAPODS What is cocoapods? CocoaPods is the dependency manager for Cocoa projects written in either Swift or Objective C. It has thousands of libraries and can help you scale your projects elegantly. Presented By Prajwal S Presentation © by Prajwal S, cosmostack.com
  • 2. DISCOVERY CocoaPods was created by Eloy Durán on August 12, 2011. 
 Taking inspiration from Bundler and RubyGems, CocoaPods was designed to resolve a list of dependencies, download the required sources, and configure the existing project in such a way to be able to use them. 
 Presentation © by Prajwal S, cosmostack.com
  • 3. USING COCOAPODS CocoaPods is easy to get started with both as a consumer and a library author. It should only take a few minutes to get set up.
 Installing CocoaPods: CocoaPods is installed through RubyGems, the Ruby package manager, which comes with a standard OS X install. To install, open Terminal.app and enter the following command: $ sudo gem install cocoapods
 Now you should have the pod command available in the terminal. Presentation © by Prajwal S, cosmostack.com
  • 4. MANAGING DEPENDENCIES A dependency manager resolves a list of software requirements into a list of specific tags to download and integrate into a project. Declaring requirements in such a way allows for project setup to be automated, which is general best practice for software development practice, no matter what the language. 
 
 Even if you don’t include third-party libraries, CocoaPods is still an invaluable tool for managing code dependencies across projects. 
 Podfile A Podfile is where the dependencies of a project are listed. It is equivalent to Gemfile for Ruby projects using Bundler, or package.json for JavaScript projects using npm. To create a Podfile, cd into the directory of your .xcodeproj file and enter the command: $ pod init Presentation © by Prajwal S, cosmostack.com
  • 5. PODFILE STRUCTURE The Sample Podfile looks like, with specifying all dependency library for the project Once all of the dependencies have been specified, they can be installed with: $ pod install 
 When this is run, CocoaPods will recursively analyze the dependencies of each project, resolving them into a dependency graph, and serializing into a Podfile.lock file. Presentation © by Prajwal S, cosmostack.com
  • 6. SEMANTIC VERSIONING 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.
 Presentation © by Prajwal S, cosmostack.com
  • 7. FUNCTIONING OF PODS CocoaPods will create a new Xcode project that creates static library targets for each dependency, and then links them all together into a libPods.a target. This static library becomes a dependency for your original application target. An xcworkspace file is created, and should be used from that point onward. This allows the original xcodeproj file to remain unchanged.
 
 Maintaining Pods: Subsequent invocations of pod install will add new pods or remove old pods according to the locked dependency graph. To update the individual dependencies of a project to the latest version, do the following: $ pod update Presentation © by Prajwal S, cosmostack.com
  • 8. < Dependant frameworks for libraries < Pods framework built with all the below libraries compiled by Pods project linked to our working project. < Library sources added by cocoapod < Frameworks built by cocoapods from dependecy library source added Presentation © by Prajwal S, cosmostack.com
  • 9. CREATING A COCOAPOD Specification:
 A .podspec file is the atomic unit of a CocoaPods dependency. It specifies the name, version, license, and source files for a library, along with other metadata. Once published to the public specs database, anyone could add it to their project, specifying their Podfile thusly.
 Sample specs:
 https://guides.cocoapods.org/making/specs-and-specs-repo.html NSAlertUtils.podspec Ruby code: $ pod spec create Presentation © by Prajwal S, cosmostack.com
  • 10. PUBLISHING A COCOAPOD To get started, you must first register your machine with the Trunk service. This is easy enough, just specify your email address along with your name. 
 $ pod trunk register prajwal.s@synchronoss.com “Prajwal S"
 
 Run pod spec lint. This is used to validate specifications. Your podspec should pass without any errors or warnings. $ pod spec lint Now, all it takes to publish your code to CocoaPods is a single command. The same command works for creating a new library or adding a new version to an existing one: $ pod trunk push NAME.podspec Presentation © by Prajwal S, cosmostack.com
  • 11. SEARCHING COCOAPODS Presentation © by Prajwal S, cosmostack.com
  • 12. PRIVATE PODS 1. Create a Private Spec Repo To work with your collection of private pods, it is suggest to create own Spec repo. This should be in a location that is accessible to all who will use the repo.
 2. Add your Private Repo to your CocoaPods installation $ pod repo add REPO_NAME SOURCE_URL Note: If you plan on creating pods locally, you should have push access to SOURCE_URL $ cd ~/.cocoapods/repos/REPO_NAME $ pod repo lint 3. Add your Podspec to your repo $ pod repo push REPO_NAME SPEC_NAME.podspec 
 This will run pod spec lint, and take care of all the little details for setting up the spec in your private repo. Presentation © by Prajwal S, cosmostack.com
  • 13. $ pod intall Thankyou Any Questions? Some short videos to understand more about cocoapods: https://www.youtube.com/playlist?list=PLqyi3cdI8X36fjtSmlZRVnvghk9mlbqjC Presentation © by Prajwal S, cosmostack.com
  • 14. ONE MORE THING……. $ pod try Hero Pod try: CocoaPods plugin which allows to quickly try the demo project of a Pod. Presentation © by Prajwal S, cosmostack.com