 class RatingControl: UIView {
 
   // MARK: Properties
-  var rating        = 0
+  var rating = 0 {
+    didSet {
+      setNeedsLayout()
+    }
+  }
+
   var ratingButtons = [UIButton]()
   var spacing       = 5
   var stars         = 5


  // MARK: Button Action
  func ratingButtonTapped(button: UIButton) {
    print("Button pressed!")
  }
}

      buttonFrame.origin.x = CGFloat(index * (buttonSize + 5))
      button.frame = buttonFrame
    }

    updateButtonSelectionStates()
  }

  override func intrinsicContentSize() -> CGSize {
