     /// The text color of the non-selected titles / options
     @IBInspectable public var titleColor: UIColor  {
         didSet {
-            if !titleLabels.isEmpty {
-                for label in titleLabels {
-                    label.textColor = titleColor
-                }
-            }
+            titleLabels.forEach { $0.textColor = titleColor }
         }
     }
     /// The text color of the selected title / option
     @IBInspectable public var selectedTitleColor: UIColor {
         didSet {
-            if !selectedTitleLabels.isEmpty {
-                for label in selectedTitleLabels {
-                    label.textColor = selectedTitleColor
-                }
-            }
+            selectedTitleLabels.forEach { $0.textColor = selectedTitleColor }
         }
     }
     /// The titles' font
     public var titleFont: UIFont = UILabel().font {
         didSet {
-            if !titleLabels.isEmpty {
-                for label in titleLabels {
-                    label.font = titleFont
-                }
-            }
+            titleLabels.forEach { $0.font = titleFont }
         }
     }
     /// The selected title's font
     public var selectedTitleFont: UIFont = UILabel().font {
         didSet {
-            if !selectedTitleLabels.isEmpty {
-                for label in selectedTitleLabels {
-                    label.font = selectedTitleFont
-                }
-            }
-        }
-    }
-    
-    // MARK: - Private properties
+            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!
     

        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

    fileprivate var totalInsetSize: CGFloat { return indicatorViewInset * 2.0 }
    fileprivate lazy var defaultTitles: [String] = { return ["First", "Second"] }()
    
    // MARK: Lifecycle
    required public init?(coder aDecoder: NSCoder) {
        index = 0
        titleColor = Color.title
        selectedTitleColor = Color.selectedTitle
        super.init(coder: aDecoder)
        titles = defaultTitles
        finishInit()
