Swift can't see the proxy property, unless I remove the <MyProperty> part.
Am I doing something wrong, or is this well known? (I've been googling and searching and asking people for a bit, so I'm hoping I'm just doing something wrong.)
(Somewhat ironically, the protocol is defined in a Swift file.)
... I apparently spoke too soon. I can't get it working now, even with the NSObjectProtocol inheritance being specified. In my .swift file, I have:
@objc public protocol MyProtocol: NSObjectProtocol {
// stuff
}
In an objc .h file, I have:
@protocol MyProtocol;
// stuff, then an @interface
@property (retain, readonly, nullable) id<MyProtocol> proxy;
(If I comment out the <MyProtocol> text, it works -- and I apparently did that before, and forgot to undo it.)
And then in a .swift file, I have:
if let proxy = loader.proxy as? MyProtocol {
}
And then it tells me that loader has an element named proxy but it may not be available in this context, and the compiler says it doesn't exist at all, which was my original problem.