CocoaHeads Rennes #13 : CocoaPods
-
Upload
cocoaheadsrns -
Category
Documents
-
view
3.250 -
download
5
description
Transcript of CocoaHeads Rennes #13 : CocoaPods
![Page 1: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/1.jpg)
The best way to manage library dependenciesin Objective-C projects.
CocoaHeads Rennes #13
Thomas Dupont
Septembre 2013
CocoaPods
![Page 2: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/2.jpg)
Introduction
avant• Fichiers sources en vrac• Pas moyen d’avoir de la conf pour le composant• On ne sait plus en quelle version est notre composant• On ne sait pas si il y a des mises à jour de nos composants• Temps de configuration
maintenant
![Page 3: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/3.jpg)
sudo gem install cocoapods
pod setup
Installation
![Page 4: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/4.jpg)
platform :ios, '5.0'xcodeproj 'Demo/Demo'
pod 'AFNetworking'pod 'STCollapseTableView'
pod install
Utilisation
![Page 5: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/5.jpg)
version x.y.z
UtilisationSemantic
Versionning
pod 'AFNetworking', '1.3.1' 1.3.1pod 'AFNetworking', '~> 1.3.1' 1.3.2pod 'AFNetworking', '~> 1.3' 1.3.2pod 'AFNetworking' 2.0.0-RC3
x = version majeurey = version mineurez = patch
![Page 6: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/6.jpg)
pod update
pod search debugkit
Utilisation
![Page 7: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/7.jpg)
platform :ios, '5.0'xcodeproj 'Demo/Demo'
pod 'AFNetworking', '~> 1.3'
target :DemoTests do pod 'OCMock', '~> 2.2' pod 'OHHTTPStubs', '~> 2.0'end
Utilisation
![Page 8: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/8.jpg)
https://github.com/CocoaPods/Specs
Pod::Spec.new do |s| s.name = "MyComponent" s.version = "1.2.3" s.summary = "A summary." s.description = <<-‐DESC A larger description. DESC s.homepage = "https://github.com/pathToMyComponent" s.license = 'MIT' s.author = { "Author" => "[email protected]" }
s.source = { :git => "https://github.com/pathToMyComponent.git", :tag => s.version.to_s } s.platform = :ios, '5.0'
s.source_files = 'MySourceFiles/*.{h,m}'
s.framework = 'Foundation', 'QuartzCore' s.requires_arc = trueend
pod spec lint myComponent.podspec
pod spec create
Créer un composant
![Page 9: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/9.jpg)
~/.cocoapods/repos
Créer un composant
pod 'MyComponent', :path => '../Components/MyComponent'
pod 'MyComponent', :git => 'https://github.com/pathToMyComponent.git'
![Page 10: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/10.jpg)
platform :ios, '5.0'xcodeproj 'Demo/Demo'
pod 'STDebugKit'
platform :ios, '5.0'xcodeproj 'Demo/Demo'
pod 'STDebugKit/CoreData'
=> Dépendance vers MagicalRecord
Subspec
![Page 11: CocoaHeads Rennes #13 : CocoaPods](https://reader034.fdocuments.in/reader034/viewer/2022052505/55667514d8b42ad5798b4a5e/html5/thumbnails/11.jpg)
Références• CocoaPods• http://cocoapods.org/
• http://docs.cocoapods.org/
• https://github.com/CocoaPods/Specs/wiki
• Composants• https://github.com/AFNetworking/AFNetworking
• https://github.com/magicalpanda/MagicalRecord
• https://github.com/iSofTom
• https://github.com/AliSoftware
• http://ocmock.org/