         }
     }
 
+    /// The color used for the selected text and the switch border.
     override public var tintColor: UIColor! {
         didSet {
             switchLayer.borderColor = tintColor.CGColor

        reloadLabelsTextColor()
    }

    override public func layoutSubviews() {
        super.layoutSubviews()
        leftLabel.frame = CGRectMake(0, 0, bounds.size.width / 2, bounds.size.height)
        rightLabel.frame = CGRectMake(bounds.size.width / 2, 0, bounds.size.width / 2, bounds.size.height)
    }

    override public func layoutSublayersOfLayer(layer: CALayer) {
        super.layoutSublayersOfLayer(layer)
        guard layer == self.layer else {

    var touchBeganInSwitchLayer = false
    var touchMoved = false

    /// Init with coder.
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setup()
