I have an Objective-C protocol which I'm trying to implement in a Swift class. For example:
@class AnObjcClass;
@protocol ObjcProtocol <NSObject>
- (void)somethingWithAnArgument:(AnObjcClass *)arg;
@end
When I try to conform to it in a Swift class like this:
@objc class SwiftClass: NSObject, ObjcProtocol {
// ...
}
I get the following scary compiler error:
Type "SwiftClass" cannot conform to protocol "ObjcProtocol" because it has requirements that cannot be satisfied.
How do I resolve this?