Slide 1

Slide 1 text

8 Jun 2015 @mrackwitz Marius Rackwitz Debugging CocoaPods

Slide 2

Slide 2 text

8 Jun 2015 @mrackwitz Using Extensions and sharing dependencies

Slide 3

Slide 3 text

8 Jun 2015 @mrackwitz USING EXTENSIONS Assume you have a project with an app target: MyApp a framework target: MyFramework an extension: MyWidget tests targets: MyAppTests, MyFrameworkTests

Slide 4

Slide 4 text

8 Jun 2015 @mrackwitz USING EXTENSIONS 1 2 3
 4 5 6
 7
 8
 9 10 11 12 13 14 15 16 17 18 19
 20 #Podfile use_frameworks! platform :ios, '8.0' target :MyApp, :exclusive => true do pod 'Alamofire' end target :MyFramework, :exclusive => true do pod 'Alamofire' end target :MyAppTests, :exclusive => true do pod 'Alamofire' pod 'KIF' end target :MyFrameworkTests, :exclusive => true do pod 'Quick' end

Slide 5

Slide 5 text

8 Jun 2015 @mrackwitz USING EXTENSIONS De-duplicate your dependencies manually in the Podfile 1 2 3
 4 5 6
 7
 8
 9 10 11 12 13 14 15 #Podfile use_frameworks! platform :ios, '8.0' pod 'Alamofire' link_with 'MyApp', 'MyAppTests', 'MyFramework', 'MyFrameworkTests' target :MyAppTests, :exclusive => true do pod 'KIF' end target :MyFrameworkTests, :exclusive => true do pod 'Quick' end

Slide 6

Slide 6 text

8 Jun 2015 @mrackwitz USING EXTENSIONS We are working on de-duplicating targets, automatically.
 Subscribe to #3550, if you’re interested in the progress. Feedback is welcome!

Slide 7

Slide 7 text

8 Jun 2015 @mrackwitz Depending on Objective-C
 from your new Swift Pod

Slide 8

Slide 8 text

8 Jun 2015 @mrackwitz DEPENDING ON OBJECTIVE-C FROM SWIFT PODS No dedicated Bridging Header by default Same as the Umbrella Header CocoaPods generates an own Umbrella Header for convenience, where all declared public headers are imported

Slide 9

Slide 9 text

8 Jun 2015 @mrackwitz SOLUTION A - USE MODULE IMPORTS Use import ObjectivePod from Swift. DISADVANTAGE You get the full Objective-C public API.

Slide 10

Slide 10 text

8 Jun 2015 @mrackwitz SOLUTION B - MAKE IT ALL PUBLIC Create a header Import all the Objective-C headers, you need,
 e.g. #import Add the header to the public_header_files DISADVANTAGE Exposes the dependency in the public API.

Slide 11

Slide 11 text

8 Jun 2015 @mrackwitz SOLUTION C - CUSTOM MODULE MAP Create a modulemap with a private submodule. Declare it in the podspec 1 2 3
 4 5 6
 7
 8
 9 10 11 #module.modulemap framework module ResearchKit
 umbrella header "ResearchKit.h"
 
 module Private {
 umbrella header "ResearchKit_Private.h"
 export *
 }
 export *
 module * { export * } }

Slide 12

Slide 12 text

8 Jun 2015 @mrackwitz Troubleshooting for Common Issues

Slide 13

Slide 13 text

8 Jun 2015 @mrackwitz TROUBLESHOOTING - RESET YOUR INTEGRATION Some changes to your Podfile, require that you re-run the integration SOLUTION gem install cocoapods-deintegrate pod deintegrate pod install

Slide 14

Slide 14 text

8 Jun 2015 @mrackwitz TROUBLESHOOTING - RESET EVERYTHING rm -rf ~/Library/Caches/CocoaPods rm -rf ~/Library/Developer/Xcode/ DerivedData pod deintegrate || rm -rf Pods pod install

Slide 15

Slide 15 text

8 Jun 2015 @mrackwitz We’re a community project.

Slide 16

Slide 16 text

8 Jun 2015 @mrackwitz HOW YOU CAN HELP File and Improve Issues Respond to questions on StackOverflow Get involved and share your experiences

Slide 17

Slide 17 text

8 Jun 2015 @mrackwitz Thanks @mrackwitz