I have a protocol (ProtocolA) containing a single property conforming to a second protocol (ProtocolB).
public protocol ProtocolA {
var prop: Prot
You need to declare a typealias
of the type that conforms to the other protocol. The way you did it is that prop
has to be exactly of type ProtocolB
, but you don't actually want that, you want a type that conforms to it instead.
protocol ProtocolA {
typealias Prop : ProtocolB
var prop: Prop? { get }
}
protocol ProtocolB {}
class ClassA : ProtocolA {
var prop: ClassB?
}
class ClassB : ProtocolB {}