Don't we need to link framework to XCode project anymore?

后端 未结 2 1805
挽巷
挽巷 2021-02-02 17:35

Base on this question

Why don\'t iOS framework dependencies need to be explicitly linked to a static library

I read the selected answer and still don\'t understa

2条回答
  •  心在旅途
    2021-02-02 17:57

    To elaborate @Tommy's answer, a framework that supports modules satisfies the following 2 conditions:

    Under Build Settings > Packaging

    • Define Modules is set to YES
    • Module Map File exists.

    So, if you're certain that the framework you're using in your code modularizes like that, you can choose to not explicitly add it in the link phase as it will be automatically added as long as in the project file, under Apple Clang - Language - Modules, The option Link Frameworks Automatically is set to YES.

提交回复
热议问题