How to suppress `warning: linking against dylib not safe for use in application extensions`?

Wayne Hartman picture Wayne Hartman · Feb 21, 2015 · Viewed 22k times · Source

I have a dynamic framework that is shared between an iOS application and an extension. There is some code in that framework that references UIApplication, that is of course, not usable in an extension. Those calls are completely isolated and so I am not worried about them causing problems with my extension.

Since there isn't a flag specified in the warning message, perhaps there isn't way to do it, but how do I suppress warning: linking against dylib not safe for use in application extensions when building my project?

Answer

Oliver Pearmain picture Oliver Pearmain · Feb 26, 2016

For your watch/today-widget extension target (so not your app or libray target), go into the project settings and change the build setting APPLICATION_EXTENSION_API_ONLY / Require Only App-Extension-Safe API to NO.