-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning - "treating #import as an import of module 'Foundation'" #10
Comments
Hi @mathaeus, Thanks for reporting this issue. Unfortunately we are unable to reproduce it (Xcode 13.2), could you provide more information about your setup (e.g. Xcode version, SwiftUI, etc.)? |
It's not a very special setup, but it is a mixed Objc/Swift code base and from what I can see somehow the bridging headers are involved. But anyway, the fix should be simple.
use
That's the more performant option anyway. EDIT: For the sake of completeness: I'm on Xcode 13.2.1, Braze SDK 4.4.1 |
Hey @mathaeus, Thanks for these details. By default, Xcode should not generate this warning unless the compiler option I was able to trigger a similar warning by setting the build setting Possible solutions:
If none of the above works for you, could you send us the output of the terminal command Best. |
Hi @lowip, thanks for looking into it.
From my screenshot above one can see that it seems to be the "generated swift bridge", so not the bridging header for importing Objc code into Swift. Sorry if my wording was confusing. That having said, we don't import any About 2) removing the compiler flag. I think it's common to have this compiler flag turned on, so turning it off doesn't sound like a long-term solution to me :) Have you considered replacing the imports as I suggested? |
Hi @mathaeus,
No worries, I couldn't find any reference online to a
I agree with you that in today's world, the With the upcoming release of our Swift SDK which will replace our ObjC SDK, this work would also quickly become obsolete.
I am curious about the reasoning with enabling this warning flag in your project. Auto-imports have been first mentioned in clang 3.3 release notes (2013) as a future direction. I haven't found much more about that feature online (e.g. SO search) and this flag is also not part of the usual umbrella warning flags |
Hi @lowip , thanks for the follow up. Glad to hear that you're working on a Swift SDK 👍. About the flag, I think most projects I worked on had this flag turned on. I'm also no expert about this, but auto-imports in general are a nice thing, because it makes it obsolete to link the system frameworks explicitly. That having said, we can live with the warning for now. I'm therefore also closing this issue. Thanks again for your input! |
Thanks for understanding our situation :). I think you can safely remove that flag as the As a reference, |
Hi, we are seeing lots of warnings of
treating #import as an import of module 'Foundation'"
Please see below.
SDK integrated via SPM
Appboy_iOS_SDK: https://github.com/braze-inc/braze-ios-sdk @ 4.4.1
The text was updated successfully, but these errors were encountered: