Using a protcol defined in a ObjectiveC header file, then using it in some Swift 4 code. The Swift code does not natively allow 'value(forKeyL key)' unless I explicitly add that method to the protocol:
X.h:
@protocol X <NSObject>
...
- (id _Nullable)valueForKey:(NSString *)key; // cannot compile Y.swift without this
@end
Y.swift:
init(info: X) {
...
guard let value = info.value(forKey: key) else { continue }
...
}
Why?