Ich habe ein Objective-C-Protokoll, das ich in einer Swift-Klasse implementieren möchte. Zum Beispiel:Typ "SwiftClass" kann nicht dem Protokoll "ObjcProtocol" entsprechen, da es Anforderungen erfüllt, die nicht erfüllt werden können
@class AnObjcClass;
@protocol ObjcProtocol <NSObject>
- (void)somethingWithAnArgument:(AnObjcClass *)arg;
@end
Wenn ich versuche, um es in einer Swift Klasse wie folgt anzupassen:
@objc class SwiftClass: NSObject, ObjcProtocol {
// ...
}
ich folgende beängstigend Compiler-Fehler:
Type "SwiftClass" cannot conform to protocol "ObjcProtocol" because it has requirements that cannot be satisfied.
Wie behebe ich Dies?