                     self.selectItemAtIndex(index)
                     self.action?(segmentedControl: self, index: index)
                     self.delegate?.segmentedControlDidPressedItemAtIndex?(self, index: index)
-                })
+            })
             addSubview(item)
             items.append(item)
             currentX += width

    }
    
    // MARK: Events

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        willPress?(item: self)
    }

    
    // MARK: Init
    
    public init (frame: CGRect, titles: [String], action: YSSegmentedControlAction? = nil) {
        super.init (frame: frame)
        self.action = action
        self.titles = titles
        defaultAppearance()
    }
    
    required public init? (coder aDecoder: NSCoder) {
        super.init (coder: aDecoder)
    }
