I have a project with both, Swift and Objective-C code. I have no warnings except one file with the project name and then the suffix -Swift.h, it is the auto generated header from the Swift files.
This file is not in my project navigator nor in the folder of the project in the Finder. I can not find it in the Build Phases to add -fno-objc-arc
.
Changing the file and adding code to suppress the warning will be deleted the next time I build the app.
At the top of the file is the line
// Generated by Swift version 1.0 (swift-600.0.47.8)
How can I get rid of this warning without disabling the helpful warnings for the other files in my project?
Warning exmaples:
Default property attribute 'assign' not appropriate for non-GC object
No 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed
@objc class ... {
internal var label: Identifier
}
SWIFT_CLASS("_TtC12...")
@interface ...
@property (nonatomic) Identifier * label; // warnings here
@end
You need to import UIKit in the file that is throwing the error.
Swift:
import UIKit
Obj C:
#import <UIKit/UIKit.h>
Also, take a look at my previous post: How to import Swift code to Objective-C
Given the above, try to disable "Defines Module", clean your project, and re-enable "Defines Module". Hope this helps.
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