I am in the process of updating my app and a common library (dynamic framework). What once was a static library as an Xcode subproject, is now a dynamic framework that contains swift code.
When writing my app's code, I'm seeing some compiler warnings. At this time, they're only warnings.
In my app's MainViewController I include a file that's written in swift. And so this has an import of App-swift.h. Inside of this autogenerated App-swift.h, there is section:
#if defined(__has_feature) && __has_feature(modules)
@import UIKit;
@import my_framework;
#endif
Inside of this 'my_framework' I have a category method on various files, e.g. NSObject+my_framework.h
Now, I'm getting a compiler warning for MainViewController.m saying "Duplicate definition of category 'my_framework' on interface 'NSObject'". The drop down supplies the locations of both definitions. One location is the actual category header file inside of my framework. The compiler 'sees' this location via it being included through the pch file. The other location links directly to my App-swift.h file at the line "@import my_framework".
Is there any way to avoid this warning?
use @import
or #import <FMK/FMK.h>
instead #import "fmk.h"
Same issue for me, I delete the line module * { export * }
from my_framework.framework/Modules/module.modulemap, so it looks like :
framework module my_framework {
umbrella header "my_framework.h"
export *
}
And the warnings disappeared. Then, added module.modulemap to my_framework project, and setted its path to the MODULEMAP_FILE build setting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With