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

        self.backgroundColor = UIColor.clearColor()
        self.initButtons()
        self.initIndicator()
    }
    
    public override func prepareForInterfaceBuilder() {

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