I am having an issue checking for objective-c protocol conformance when it is inherited from a swift protocol. As far as I understand the following code should print true. (Swift 3)
import UIKit
protocol MyProtocol: UITableViewDelegate {}
class MyClass: UIViewController, MyProtocol {}
let myClass = MyClass()
print(myClass.conforms(to: UITableViewDelegate.self))
// prints false
let viewController = myClass as UIViewController
print(viewController as? UITableViewDelegate ?? "not a delegate")
// prints not a delegate
If anyone knows why this is happening or how to properly check this conformance that'd be great
