Slide 1

Slide 1 text

powered by

Slide 2

Slide 2 text

CocoaPods Felix Schulze ([email protected]) Teamlead Mobile Software Development Dependency-Management for iOS

Slide 3

Slide 3 text

Survey!?

Slide 4

Slide 4 text

Dependency- Management Tool!

Slide 5

Slide 5 text

Why CocoaPods? • Automate everything! • Save time • Consistant workspace • Really easy updates • Automatic dependency resolution • Solid Xcode configs • Divide project and third party library settings • Docs integrated • Easy to integrate

Slide 6

Slide 6 text

Design • Pod = Dependency / Library • Podfile = Description of project dependencies • Podspec = Specification of an Library

Slide 7

Slide 7 text

Install CocoaPods [sudo] gem install cocoapods! pod setup

Slide 8

Slide 8 text

Demo

Slide 9

Slide 9 text

Integrate CocoaPods • Create Podfile Analyzing dependencies Downloading dependencies Installing AFNetworking (2.1.0) Generating Pods project Integrating client project ! [!] From now on use `PodDemo.xcworkspace`. platform :ios, '6.0' ! pod 'AFNetworking', '2.1.0' • Run pod install

Slide 10

Slide 10 text

Project.xcodeproj Podfile Project.xcodeproj Pods/AFNetworking Pods/SVProgressHUD Pods/Objection pod install

Slide 11

Slide 11 text

Podfile pod 'AFNetworking', '2.1.0' platform :ios, '6.0' inhibit_all_warnings! ! xcodeproj PodDemo.xcodeproj ! pod 'AFNetworking', '2.1.0' pod 'SVProgressHUD', :head ! target :PodDemoTests do pod 'OCMock', '~> 2.2.2' end ! pod 'LocalSourceSpecialPod' :path => 'Libs/LSSP.podspec' pod 'RemoteSourceSpecialPod', :podspec => 'Libs/RSSP.podspec' pod 'RemotePod', :podspec => 'http://goo.gl/HTJ3Ls'

Slide 12

Slide 12 text

Semantic versions x: Major version • Major API Changes • Look for incompatibility y: Minor version • Backward compatible • Changes could be needed z: Patch version • Backward compatible • No changes needed x.y.z

Slide 13

Slide 13 text

Semantic versions '1.2' Only 1.2 '>1.2' Higher 1.2 '>=1.2' 1.2 or Higher '<1.2' Lower 1.2 '<=1.2' 1.2 or Lower '~>1.2.1' 1.2.1 or Higher AND Lower 1.3 :head Head version from repo

Slide 14

Slide 14 text

Podspec Pod::Spec.new do |s| s.name = „AutoScout24 Demo Library" s.version = "1.0" s.summary = "Some description" s.homepage = "https://github.com/AutoScout24/DemoLibrary" s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { "Felix Schulze" => "[email protected]" } s.source = { :git => "https://github.com/AutoScout24/DemoLibrary.git", :tag => s.version.to_s } ! s.platform = :ios, '5.0' s.requires_arc = true ! s.source_files = 'ASCDemoLibrary*.{h,m}' s.resources = 'ASCDemoLibrary.bundle' ! s.framework = 'Foundation', 'UIKit', 'CoreGraphics', 'QuartzCore' s.weak_frameworks = 'AdSupport‘ ! s.dependency 'AFNetworking', '~> 1.3' ! end

Slide 15

Slide 15 text

Examples • ARC vs. Non ARC • AFNetworking 1.x -> 2.x • OTHER_LINKER_FLAGS • Linked Frameworks • iOS Versions

Slide 16

Slide 16 text

Links • http://guides.cocoapods.org/ • https://github.com/CocoaPods/CocoaPods • https://github.com/CocoaPods/Specs

Slide 17

Slide 17 text

Questions + Contact • Felix Schulze @x2on • [email protected] • github.com/AutoScout24 • github.com/x2on

Slide 18

Slide 18 text

powered by