         guard let index = self.buttons?.indexOf(button) else {
             return
         }
+        
         self.setSelectedSegmentIndex(index)
         self.sendActionsForControlEvents(.ValueChanged)
     }

    private var buttons: [UIButton]?
    private var items: [String] = ["First", "Second"]
    
    @IBInspectable public var font: UIFont = UIFont.systemFontOfSize(UIFont.systemFontSize()) // Wait for a day UIFont will be inspectable
    @IBInspectable public var titleColor: UIColor? {
        didSet {
            self.configureView()
        }
    }
    @IBInspectable public var indicatorColor: UIColor? {
        didSet {
            self.configureView()

    
    private func configureButton(button: UIButton) {
        button.titleLabel?.font = self.font
        button.setTitleColor(self.colorToUse(self.titleColor), forState: .Selected)
        button.setTitleColor(self.unselectedTitleColor, forState: .Normal)

    }
    
