I wrote SearcherProtocol in Swift and need to implement an Objective-C class FileSearcher which has to use this protocol.
So I tried this:
When you have
#import "moduleName-Swift.h"
in the .h file that you want to be a delegate, and you have that .h file also in the bridging headers file, there's a circular reference that causes the moduleName-Swift.h to fail compilation. for @james_alvarez's test project, it's probably working because you don't need to include TestObjClass.h into the bridging header.
The best way for me to combine objc files that need to be the delegate for a class written in swift, but that also needs to be included in the bridging header so other swift files can access this objc class, is to create a separate protocol file in objc:
MyProtocol.h:
@protocol MyDelegate
-(void)didDoThis;
-(void)didDoThat;
@end
ViewController.h:
#import "MyProtocol.h"
@interface ViewController : UIViewController
MyProject-Bridging-Header.h
#import "MyProtocol.h"
#import "ViewController.h"