In Objective-C there is a way to declare a variable conforming to a class and a set of protocols like this:
BaseClass<Protocol1, Protocol2> *variable = ...
In Swift I would like to declare an array (actually as a property of a class) with elements of a type defined by this pattern.
In this question there is a solution for describing the type of a standalone property by making the class generic and constraining the type accordingly. In order to instantiate such a class it would be necessary to specify the exact type. This is not a problem for a standalone property, but in an array there should be possible to store elements with different exact types.
Is there a way how to express this in Swift?