         return UInt(distances.index(of: distances.min()!)!)
     }
     fileprivate func moveIndicatorView() {
-        self.indicatorView.frame = self.titleLabels[Int(self.index)].frame
-        self.layoutIfNeeded()
-    }
-    
-    // MARK: - Action handlers
+        indicatorView.frame = titleLabels[Int(self.index)].frame
+        layoutIfNeeded()
+    }
+    
+    // MARK: Action handlers
     @objc fileprivate func tapped(_ gestureRecognizer: UITapGestureRecognizer!) {
         let location = gestureRecognizer.location(in: self)
         try! setIndex(nearestIndex(toPoint: location))
     }
-    @objc fileprivate func pan(_ gestureRecognizer: UIPanGestureRecognizer!) {
+    @objc fileprivate func panned(_ gestureRecognizer: UIPanGestureRecognizer!) {
         guard !panningDisabled else {
             return
         }

        self.indicatorViewBackgroundColor = indicatorViewBackgroundColor
        finishInit()
    }
    @available(*, deprecated, message: "Use init(frame:titles:index:backgroundColor:titleColor:indicatorViewBackgroundColor:selectedTitleColor:) instead.")
    convenience public init(titles: [String]) {
        self.init(frame: CGRect.zero,
                  titles: titles,
                  index: 0,
                  backgroundColor: DefaultColors.backgroundColor,
                  titleColor: DefaultColors.titleColor,
                  indicatorViewBackgroundColor: DefaultColors.indicatorViewBackgroundColor,
                  selectedTitleColor: DefaultColors.selectedTitleColor)
    }
    
    @available(*, deprecated, message: "Use init(frame:titles:index:backgroundColor:titleColor:indicatorViewBackgroundColor:selectedTitleColor:) instead.")
    convenience override public init(frame: CGRect) {
        self.init(frame: frame,
                  titles: ["First", "Second"],
                  index: 0,
                  backgroundColor: DefaultColors.backgroundColor,
                  titleColor: DefaultColors.titleColor,
                  indicatorViewBackgroundColor: DefaultColors.indicatorViewBackgroundColor,
                  selectedTitleColor: DefaultColors.selectedTitleColor)
    }
    @available(*, unavailable, message: "Use init(frame:titles:index:backgroundColor:titleColor:indicatorViewBackgroundColor:selectedTitleColor:) instead.")
    convenience init() {
        self.init(frame: CGRect.zero,
                  titles: ["First", "Second"],
                  index: 0,
                  backgroundColor: DefaultColors.backgroundColor,
                  titleColor: DefaultColors.titleColor,
                  indicatorViewBackgroundColor: DefaultColors.indicatorViewBackgroundColor,
                  selectedTitleColor: DefaultColors.selectedTitleColor)
    }
    fileprivate func finishInit() {
        layer.masksToBounds = true

    /// The text color of the non-selected titles / options
    @IBInspectable public var titleColor: UIColor  {
        didSet {
            titleLabels.forEach { $0.textColor = titleColor }
        }
    }
    /// The text color of the selected title / option
    @IBInspectable public var selectedTitleColor: UIColor {
        didSet {
            selectedTitleLabels.forEach { $0.textColor = selectedTitleColor }
        }
    }
    /// The titles' font
    public var titleFont: UIFont = UILabel().font {
        didSet {
            titleLabels.forEach { $0.font = titleFont }
        }
    }
    /// The selected title's font
    public var selectedTitleFont: UIFont = UILabel().font {
        didSet {
            selectedTitleLabels.forEach { $0.font = selectedTitleFont }
        }
    }
    fileprivate let titleLabelsView = UIView()
    fileprivate let selectedTitleLabelsView = UIView()
    fileprivate let indicatorView = IndicatorView()
    fileprivate var initialIndicatorViewFrame: CGRect?

    fileprivate var tapGestureRecognizer: UITapGestureRecognizer!
    fileprivate var panGestureRecognizer: UIPanGestureRecognizer!
    
