Swift のどのバージョンでも、クラス/プロトコル型の制約が混在するプロトコルを拡張することは可能ですか? たとえば、が のサブクラスであり、 に準拠しているProtocol2
場合にのみ拡張したいと考えています。Self
UIViewController
Protocol1
protocol Protocol1 {}
protocol Protocol2 {}
//What I imagine I could do, but it does not compile
extension Protocol2 where Self: UIViewController, Protocol2 {}