Swift generic type conforming to two protocols
Things have been changed in Swift 4:
func foo<T: UIViewController> (viewController: T) where T:UIPickerViewDelegate {}
Your code:
func foo<T: UIViewController, UIPickerViewDelegate> (#viewController: T) {}
declares 2 generics parameters:
T
which isUIViewController
. And it's used asviewController
parameter type.UIPickerViewDelegate
which isAny
. And it's not used.
Instead, you should use "Where Clause", like:
func foo<T: UIViewController where T:UIPickerViewDelegate> (#viewController: T) {}