I have a protocol that I defined like so:
protocol MyProtocol { ... }
I also have a generic struct:
struct MyStruct <
A modern answer will be like this: (Swift 5.1)
func myFunc < T: MyProtocol> (s: MyStruct) -> T? { ... }