I have a project with
- one application target:
MyApp
- one Embedded Framework target:
MyKit.framework
- one application extension target:
MyExtension
I want to use the shared code of MyKit
in the MyExtension
but when I link it, I get the warning
ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/me/Library/Developer/Xcode/DerivedData/MyApp-dnztzmxjghjlsteetlokzhjtjqkm/Build/Products/Debug-iphonesimulator/MyKit.framework/MyKit
To configure an app extension target to use an embedded framework, set the target’s “Require Only App-Extension-Safe API” build setting to Yes. If you don’t, Xcode reminds you to do so by displaying the warning “linking against dylib not safe for use in application extensions”.
which is correctly set by default. I could get rid of the warning by setting "Require Only App-Extension-Safe API" to NO but this could lead to some app rejections.
The framework does not use any API not allowed in an app extension. In fact, in the sample project, you'll see that MyKit.framework
only logs a message to a console.
What is a correct way to link to en embedded framework from an app extension to avoid this wrning?