     public override func layoutSubviews() {
         super.layoutSubviews()
         updateTabs()
+    }
+    
+    public override func tintColorDidChange() {
+        updateColors()
     }
     
 }

    
    // MARK: - Inspectable properties
    
    @IBInspectable public var underlineHeight: CGFloat = 2.0 {
        didSet {
            underlineHeightConstraint?.constant = underlineHeight
        }
    }
    
    @IBInspectable public var underlineOnBottom: Bool = true {
        didSet {
            configureVerticalPositions()
        }
    }
    
    @IBInspectable public var selectedIndex: Int = 0 {
        didSet {
            updateTabs()
        }
    }
    
    @IBInspectable public var accentColor: UIColor = UIColor.blueColor() {
        didSet {
            updateColors()
        }
    }
    
    @IBInspectable public var defaultTitleColor: UIColor = UIColor.blackColor() {
        didSet {
            updateColors()
        }

    }
    
    func configureVerticalPositions() {
        if underlineTop {
            underlineBottomConstraint?.active = false
            underlineTopConstraint?.active = true
        } else {
            underlineBottomConstraint?.active = true
            underlineTopConstraint?.active = false
        }
        
        let shadowHeight = 0.5
        let shadowWidth = 0.0

        let shadowOffset: CGSize
        if shadowTop {
            shadowOffset = CGSize(width: shadowWidth, height: -shadowHeight)
        } else {
            shadowOffset = CGSize(width: shadowWidth, height: shadowHeight)
        }
        
        layer.shadowOffset = shadowOffset
