SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
Bore%Da! 
• Diego'Freniche 
• @dfreniche 
• I'develop'Apps 
• also'teach'people'how'to'do'it 
• iOS/Android/BB10/webOS/... 
Ultra&geek*CV:*h/ps://github.com/dfreniche/cv
Warning! 
• This&talk&is&maybe&Dave&Addey&approved 
• I'm&going&to&talk&about&lots&of&third&party&libraries,&specially&for& 
networking&code,&so&for$sure$is$not$Markus$Zarra$approved!
The$tradi*onal*$approach$to$library$ 
management 
like%in%"tradi,onal"%==%bad
• write'your'code 
• find'some'libraries'on'StackOverflow 
• download'them'from'github 
• unzip'&'add'to'your'project 
• which%folder%do%I%have%to%add%to%my%project? 
• try'to'keep'that'mess'organized 
• ...'good'luck'with'that'
What%if...? 
• there's(a(new(version(of(your(libs(with(more(features? 
• there's(a(fixed(bug(you(don't(know(about? 
• GOTO$Tradi)onal$approach
Cocoa%Pods%light%introduc1on 
• Abstract 
• The,idea 
• The,Philosophy,behind,Cocoa,Pods 
• Something,very,clever,here 
• Are,you,s;ll,awake? 
• Kill,by,PowerPoint 
Slide&1&/&300
Talk%is%cheap.%Show%me%the%code. 
• Linus'Torvalds
Install'Cocoa'Pods 
The$easy$way: 
$ sudo gem install cocoapods 
Update'Cocoa'Pods 
GOTO EASY_WAY
A"pod"file 
platform :ios, '7.0' 
pod "AFNetworking", "~> 2.0" 
pod "ARAnalytics", "~> 2.7"
Create&pod&file 
$ pod init
Using&more&than&one&target? 
platform :ios, "6.0" 
target "SuperHeroes" do 
end 
target "SuperHeroesTests" do 
end
Final&pod&file 
platform :ios, "6.0" 
target "SuperHeroes" do 
pod 'AFNetworking', '~> 2.2' 
pod "NSLogger" 
end 
target "SuperHeroesTests" do 
end
Install'pods 
pod install 
Analyzing dependencies 
Downloading dependencies 
Installing AFNetworking (2.3.1) 
Installing NSLogger (1.2) 
Generating Pods project 
Integrating client project 
[!] From now on use `SuperHeroes.xcworkspace`.
[!]$From$now$on$use$SuperHeroes.xcworkspace.
[!]$From$now$on$use$ 
SuperHeroes.xcworkspace.
Duplicated+code! 
Delete%duplicated%code...%Sweet!
Change'imports 
#import "NSLogger.h" 
becomes: 
#import <NSLogger.h>
It#compiles#and#run 
But$doesn't$run$tests
link_with 'MainTarget', 'MainTargetTests' 
Move pods to common area 'MainTarget' 
$ pod install 
Because'StackOverflow
Edit%Podfile%within%Xcode 
• even%install%Pods%using%Alcatraz%+%Cocoa%Pods%plugin 
• Run%pod install%from%Xcode!
Use$Groups,$please! 
• But%groups%alone%doesn't%suffice 
• No%Finder%organiza7on
Enter&Synx! 
• h#ps://github.com/venmo/synx 
• Install9it: 
$ sudo gem install synx 
• Use%it 
$ synx SuperHeroes.xcodeproj/
Our$own$libraries$as$Pods
You$need$two$things 
• Your&library&repo 
• A&PodSpec,&inside&a&repo 
Add#that#PodSpec#to#the#Cocoapods#specs
git init 
git add README.md 
git commit -m "Initial commit" 
git remote add origin https://github.com/dfreniche/Private-CocoaPods.git 
git push -u origin master 
cd MarvelAPIHelper/0.0.1/
Create&the&Spec 
pod$spec$create$PrivateLibrary 
Check&the&spec 
pod$spec$lint$PrivateLibrary.podspec
Add#repo#to#CocoaPods#list 
pod$repo$add$MarvelAPIHelper$h0ps://github.com/dfreniche/ 
Private>CocoaPods.git 
Update'the'spec 
pod$repo$update$MarvelAPIHelper 
How$to$remove$a$Private$Repo 
pod$repo$remove$[name]
Check&our&newly&installed&spec! 
cd ~/.cocoapods/repos 
cd MarvelAPIHelper/ 
pod repo lint .
Success! 
/usr/bin/pod install 
Analyzing dependencies 
Downloading dependencies 
Using AFNetworking (2.3.1) 
--> Installing MarvelAPIHelper (0.0.1) 
Using NSLogger (1.2) 
Using OCHamcrest (4.0.1) 
Using OCMockito (1.3.0) 
Using TPWeakProxy (1.0.0) 
Generating Pods project 
Integrating client project
Review 
• CocoaPods:*best*tool*for 
• 3rd*party*library*management 
• conflict*/*dependencies*resolu;on 
• stay*updated 
• managing*your*own*libraries
Thanks! 
Everything+was+crystal+clear,+so+no+ques5ons+ 
needed 
Contact'/'send'beer:'@dfreniche
Links 
• h#p://cocoapods.org 
• Private4pod4spec4repo:4h#ps://github.com/dfreniche/Private: 
CocoaPods 
• Example4App4using4Pods4and4the4private4Pod:4h#ps://github.com/ 
dfreniche/MarvelAPIHelper

Weitere ähnliche Inhalte

Ähnlich wie Cocoa pods iOSDevUK 14 talk: managing your libraries

SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
Justin Ryan
 
Javascript orientado a testes
Javascript orientado a testesJavascript orientado a testes
Javascript orientado a testes
Alexandre Gomes
 

Ähnlich wie Cocoa pods iOSDevUK 14 talk: managing your libraries (20)

Giving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOS
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Do you really understand Git?
Do you really understand Git?Do you really understand Git?
Do you really understand Git?
 
Vagrant + Veewee : Barcampboston April 10-2011
Vagrant + Veewee : Barcampboston April 10-2011Vagrant + Veewee : Barcampboston April 10-2011
Vagrant + Veewee : Barcampboston April 10-2011
 
Full-Stack CakePHP Deployment
Full-Stack CakePHP DeploymentFull-Stack CakePHP Deployment
Full-Stack CakePHP Deployment
 
CocoaPods introduction
CocoaPods introductionCocoaPods introduction
CocoaPods introduction
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and Jenkins
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 
Packaging Software, Puppet Labs Style - PuppetConf 2014
Packaging Software, Puppet Labs Style - PuppetConf 2014Packaging Software, Puppet Labs Style - PuppetConf 2014
Packaging Software, Puppet Labs Style - PuppetConf 2014
 
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
Common configuration with Data Bags - Fundamentals Webinar Series Part 4Common configuration with Data Bags - Fundamentals Webinar Series Part 4
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
 
Gophers, whales and.. clouds? Oh my!
Gophers, whales and.. clouds? Oh my!Gophers, whales and.. clouds? Oh my!
Gophers, whales and.. clouds? Oh my!
 
How to Contribute to Ansible
How to Contribute to AnsibleHow to Contribute to Ansible
How to Contribute to Ansible
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
Javascript orientado a testes
Javascript orientado a testesJavascript orientado a testes
Javascript orientado a testes
 

Mehr von Diego Freniche Brito

Mehr von Diego Freniche Brito (9)

Los mejores consejos para migrar de RDBMS a MongoDB.pptx.pdf
Los mejores consejos para migrar de RDBMS a MongoDB.pptx.pdfLos mejores consejos para migrar de RDBMS a MongoDB.pptx.pdf
Los mejores consejos para migrar de RDBMS a MongoDB.pptx.pdf
 
From Mobile to MongoDB: Store your app's data using Realm
From Mobile to MongoDB: Store your app's data using RealmFrom Mobile to MongoDB: Store your app's data using Realm
From Mobile to MongoDB: Store your app's data using Realm
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented Programmers
 
Swift as a scripting language iOSDevUK14 Lightning talk
Swift as a scripting language iOSDevUK14 Lightning talkSwift as a scripting language iOSDevUK14 Lightning talk
Swift as a scripting language iOSDevUK14 Lightning talk
 
Charla XVII Beta Beers Sevilla: ¿Ágil? Como la rodilla de un click
Charla XVII Beta Beers Sevilla: ¿Ágil? Como la rodilla de un clickCharla XVII Beta Beers Sevilla: ¿Ágil? Como la rodilla de un click
Charla XVII Beta Beers Sevilla: ¿Ágil? Como la rodilla de un click
 
Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14
 
Core data intermediate Workshop at NSSpain 2013
Core data intermediate Workshop at NSSpain 2013Core data intermediate Workshop at NSSpain 2013
Core data intermediate Workshop at NSSpain 2013
 
Core data basic Workshop slides NSSpain 2013
Core data basic Workshop slides NSSpain 2013Core data basic Workshop slides NSSpain 2013
Core data basic Workshop slides NSSpain 2013
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Cocoa pods iOSDevUK 14 talk: managing your libraries