I am integrating Swift into a large existing Objective C project and have run into what I think is a circular reference.
The classes in question are as follows:
Objective C Controller
#import "Hopscotch-Swift.h"
@interface MyController : UIViewController<MyProtocol>
...
@end
Swift Protocol
@objc protocol MyProtocol: NSObjectProtocol {
...
}
Bridging Header
#import "MyController.h"
This code fails to compile because the Hopscotch-Swift.h
file will not generate.
I think this is due to a circular reference error as I can import Hopscotch-Swift.h
into objective c headers that are not included in Hopscotch-Bridging-Header.h
and it works fine.
Is there a workaround for this issue or should I file a radar with Apple?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…