Search code examples
iosmacoscocoapodspodspec

CocoaPods for both iOS and OS X?


I have a static library that I've created for iOS 8 and have created a corresponding pod spec file so it can be delivered via CocoaPods. I'd also like to build and distribute this library on OS X, as well. Is this possible? How do I need to setup the project structure and the pod spec file(s)? Do I need to do anything special?


Solution

  • Yes it's possible. See the multi-platform support documentation. Basically you use spec.ios and spec.osx to specify platform-specific attributes - e.g. spec.ios.resources instead of spec.resources to specify iOS-specific resources. AFNetworking's podspec is a good example to have a look at.