I'm getting this really weird error when trying to import UIKit in my swift file.
My Code is simply:
import UIKit
class Test: NSObject {
}
The error I get at 'import UIKit' is:
I have added UIKit to my Frameworks folder, the class doesn't contain any code (so therefore there shouldn't be anything wrong with it) and I tried to restart both xCode and my Mac, but the error is still there.
I appreciate any help.
Thanks.
EDIT: Solved:
I tried to import 'Test.swift' in AppDelegate.
This problem usually happens when you try to import ".swift" file in your Objective-C code, like this: #import "HomeViewController.swift"
. This is wrong and you should import special, automatically generated Swift header, instead:
#import "ProductModuleName-Swift.h"
where ProductModuleName
is the name of your module (or project) containing the Swift code.
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