Ossir
Ossir

Reputation: 3145

Should I add Foundation and other standard frameworks in CocoaPods dependencies?

I want to create podspec and I'm wondering what dependencies I need to add in it. The library I'm creating podspec file for have the only one dependency. It depends on Foundation framework.

As I know all newly created iOS application already have import of Foundation in prefix file. Does it mean that all apps built above Foundation and I don't have to add dependency on it or not? And where is the line which Apple's frameworks I need to specify as explicit dependency in CocoaPods and which frameworks I can rely on.

Please, clarify it to me. Thanks!

Upvotes: 4

Views: 861

Answers (1)

Oxcug
Oxcug

Reputation: 6604

I wouldn't worry about it. Any iOS app that doesn't include Foundation would be an app that would literally not be able to use a good 99% of the available frameworks in iOS. And besides, the linker error that'll arise would be pretty self explanatory.

And like you've said, by default, all iOS apps come with Foundation imported already. So it's a fair assumption any user deploying your CocoaPod will have Foundation.

Frameworks like SpriteKit, AVFoundation, CoreBluetooth, CoreLocation, etc. Should be dependencies since they're not essential to a regular app.

Upvotes: 2

Related Questions