Swift Protocols: Adding Protocol conformance to an Instance
<p>I'm trying to understand how to add a protocol conformance to an instance if the instance has a particular value. This is a "stupid" example of what I'm trying to understand.</p>

<pre><code>enum TypeOfFigure {
  case square, circle, triangle
}

protocol Figure {
    var type: TypeOfFigure { get }
}
protocol Square {}
protocol Circle {}
protocol Triangle {}


class FigureType: Figure {
    let type: TypeOfFigure

    init (type: TypeOfFigure) {
        self.type = type
        switch type {
        case .square: //extension self: Square {}
        case .circle: //extension self: Circle {}
        case .triangle: //extension self: Triangle {}
        }
    }

}
</code></pre>