The SituationI recently returned to iOS from a year-old Android hiatus. On my last iOS project, I used cocoapods as my dependency manager, but this was bolted onto an existing codebase. I'm starting fresh now, and I want to find a canonical project structure for a cocoapod (think AFNetworking, CocoaLumberjack, etc).
I don't want to have duplicate configuration between an Xcode project and a podspec. Ideally, cocoapods would configure a project with which I can do daily development.
Development Pods! Specifically, create a demo project for your cocoapod, and use the demo project's
Podfileto import your cocoapod into Xcode:
Using the files from a local path.http://guides.cocoapods.org/syntax/podfile.html#pod
If you wold like to use develop a Pod in tandem with its client project you can use the path option.
pod 'MyPod', :path => 'MyPod/MyPod'
Using this option CocoaPods will assume the given folder to be the root of the Pod and will link the files directly from there in the Pods project. This means that your edits will persist to CocoaPods installations.
I created a Single-View iOS App, which yielded a project structure like this:
podspecis a supporting file, so it belongs in
MyPod-Info.plistand friends. Now, if I want to modify my cocoapod's configuration by adding an AFNetworking dependency, I only need to change my