How do I use Cocoapods in an embedded framework?

后端 未结 2 1858
迷失自我
迷失自我 2021-01-30 03:17

I\'m using an embedded framework for my custom views in a new project to take advantage of the new @IBDesignable stuff in Xcode 6 and I\'d like to animate said views with Facebo

2条回答
  •  甜味超标
    2021-01-30 03:48

    I guess you are modifying the framework to use Pop. In this case you'll also need to add the Pop headers' path to the framework Build Settings' search header paths.

    But then if you're modifying the framework you could just create a podspec for it as well and let CocoaPods handle everything (and send a pull request to the creator?).


    As for the bounty question.

    A framework should never embed other libraries. If for instance you want to use AFNetworking in your library:

    • State that AFNetworking is required in your own framework installation instructions.
    • If you distribute binaries you just build locally against AFNetworking headers. Users will need to provide their own AFNetworking when linking their App.
    • If you distribute source code with your framework (if users have to build it themselves) then ask in your installation steps to set the AFNetworking headers path in your frameworks Build Settings Header Search Paths and preset it to common paths such as POD_ROOT, etc.

    Then it works but you have complex installation instructions, users have to manually add resources if any, it is hard to control the AFNetworking version being added by users and most will never upgrade your framework because it may break their setup. All good reasons to support CocoaPods by creating a podspec (you can keep maintaining the framework/static library project if you really want).

提交回复
热议问题