I have a new Swift project with a few files, I've needed to add some Objc code.
In Build Settings
, my Objective-C Generated Interface Header Name
is MyProject-Swift.h
Product Module Name
and Product Name
are both MyProject.
My Objective-C Bridging Header
is MyProject/MyProject-Bridging-Header.h
The contents of my Bridging Header
are:
#ifndef MyProject_Bridging_Header_h
#define MyProject_Bridging_Header_h
#import "Blakey.h"
#endif
Blakey.h
is pretty simple:
@import Foundation;
#import "MyProject-Swift.h"
@class KeyPair;
@interface Blakey: NSObject
- (void)createKeyPairForSeed:(NSString *)seed;
@end
And Blakey.m
#import <Foundation/Foundation.h>
#import "Blakey.h"
@implementation Blakey
- (void)createKeyPairForSeed:(NSString *)seed;
{
}
@end
(side note: I'm aware my function returns a void, that will be changed later once this issue is fixed so it returns an actual value)
Why is Xcode throwing an error at the #import "MyProject-Swift.h"
in Blakey.h
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…