         var buttonFrame = CGRect(x: 0, y: 0, width: buttonSize, height: buttonSize)
 
         for (index, button) in ratingButtons.enumerate() {
-            buttonFrame.origin.x = CGFloat(index * (buttonSize + 5))
+            buttonFrame.origin.x = CGFloat(index * (buttonSize + spacing))
             button.frame = buttonFrame
         }
         updateButtonSelectionStates()


        super.init(coder: aDecoder)

        for _ in 0..<5 {
            addButton()
        }
    }

        }
    }
    var ratingButtons = [UIButton]()

    var stars = 5
    var spacing = 5

    var filledStarImage: UIImage
    var emptyStarImage: UIImage

