title: How to add Layer to UIButton subclass in Protocol oriented way in swift?
body: <p>I want to learn programming in protocol oriented manner. And I want that <code>StartButton</code> and <code>StopButton</code> subclasses both just conform to <code>Roundable</code> protocol, so that they'll have a rounded layer inside of them.</p>
  
  <p>Right now my StartButton subclass looks like this:</p>
  
  <pre><code>  var backgroundLayer: CAShapeLayer = CAShapeLayer()
  
  
    required init?(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
      backgroundLayer.fillColor = Colors.Background.button.cgColor
      backgroundLayer.rasterizationScale = 2.0 * UIScreen.main.scale
      backgroundLayer.shouldRasterize = true
      layer.addSublayer(backgroundLayer)
    }
  
    override func layoutSubviews() {
      super.layoutSubviews()
      backgroundLayer.path = UIBezierPath(ovalIn: self.bounds).cgPath
    }
  </code></pre>
  
  <p>Whats the best way to do that with a protocols approach?</p>