 // MARK: - UIGestureRecognizer Delegate
 extension AnimatedSegmentSwitch: UIGestureRecognizerDelegate {
 
-    override func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool {
+    override public func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool {
         if gestureRecognizer == panGesture {
             return thumbView.frame.contains(gestureRecognizer.locationInView(self))
         }


// MARK: - AnimatedSegmentSwitch

@IBDesignable class AnimatedSegmentSwitch: UIControl {

    // MARK: - Public Properties

    var items: [String] = ["Item 1", "Item 2", "Item 3"] {
        didSet {
            setupLabels()
        }
    }

    var selectedIndex: Int = 0 {
        didSet {
            displayNewSelectedIndex()
        }
    }

    var animationDuration: NSTimeInterval = 0.5
    var animationSpringDamping: CGFloat = 0.6
    var animationInitialSpringVelocity: CGFloat = 0.8

    // MARK: - IBInspectable Properties

    @IBInspectable var selectedTitleColor: UIColor = UIColor.blackColor() {
        didSet {
            setSelectedColors()
        }
    }

    @IBInspectable var titleColor: UIColor = UIColor.whiteColor() {
        didSet {
            setSelectedColors()
        }
    }

    @IBInspectable var font: UIFont! = UIFont.systemFontOfSize(12) {
        didSet {
            setFont()
        }
    }

    @IBInspectable var borderColor: UIColor = UIColor.whiteColor() {
        didSet {
            layer.borderColor = borderColor.CGColor
        }
    }

    @IBInspectable var cornerRadius: CGFloat! {
        didSet {
            layer.cornerRadius = cornerRadius
        }
    }

    @IBInspectable var thumbColor: UIColor = UIColor.whiteColor() {
        didSet {
            setSelectedColors()
        }
    }

    @IBInspectable var thumbCornerRadius: CGFloat! {
        didSet {
            thumbView.layer.cornerRadius = thumbCornerRadius
        }
    }

    @IBInspectable var thumbInset: CGFloat = 2.0 {
        didSet {
            setNeedsLayout()
        }


    // MARK: - Layout

    override public func layoutSubviews() {
        super.layoutSubviews()

        layer.cornerRadius = cornerRadius ?? frame.height / 2
