     }
     
     
+    
     deinit{
         NSNotificationCenter.defaultCenter().removeObserver(self)
     }

extension BXProgressHUD{
    // MARK: KVO
    func shouldUpdateIndicators(){
        updateIndicators()
        setNeedsLayout()
        setNeedsDisplay()
    }
    
    func shouldUpdateUI(){
        setNeedsLayout()

    }
    
    private var _hasInstalledConstraints = false
    private var _prevModeConstraints:[NSLayoutConstraint] = []
    func  installConstraints() {
        if _hasInstalledConstraints{
            return
        }
        _hasInstalledConstraints = true
        _prevModeConstraints.removeAll()
        NSLog("\(__FUNCTION__)")
        hudSize = measure()
        let yPos = (bounds.height - hudSize.height) * 0.5 + margin + yOffset
        let allViews:[UIView?] = [ indicator,label,detailsLabel ]
        let padding = BXProgressOptions.padding
        var prevView:UIView?
        for view in allViews{
            if let view  = view{
                view.translatesAutoresizingMaskIntoConstraints = false
                let cx = view.pinCenterX()
                _prevModeConstraints.append(cx)
                if let prevView = prevView{
                   let cb = view.pinBelowSibling(prevView, margin: padding)
                    _prevModeConstraints.append(cb)
                    
                }else{
                    let ct = view.pinTop(yPos)
                    _prevModeConstraints.append(ct)
                }
                prevView = view
            }
        }
        
    }
    
    
    
    
    public override func drawRect(rect: CGRect) {
        super.drawRect(rect)
