                 options:[],
                 metrics:metrics,
                 views:views))
+            
+            alert.layoutTop = NSLayoutConstraint(
+                item:alert,
+                attribute:NSLayoutAttribute.top,
+                relatedBy:NSLayoutRelation.equal,
+                toItem:rootView,
+                attribute:NSLayoutAttribute.top,
+                multiplier:1,
+                constant:-kHeight)
+            
+            rootView.addConstraint(alert.layoutTop)
+            rootView.setNeedsLayout()
         }
     }
     

    static let kMarginTop:CGFloat = 10
    static let kMarginHorizontal:CGFloat = 10
    static let kHeight:CGFloat = 60
    
    class func message(message:String)
    {

        clipsToBounds = true
        backgroundColor = UIColor.complement
        translatesAutoresizingMaskIntoConstraints = false
    }
    
    //MARK: public
    
    func animate(open:Bool)
    {
        if open
        {
            layoutTop.constant = VAlert.kMarginTop
        }
        else
        {
            layoutTop.constant = -VAlert.kHeight
        }
        
        UIView.animate(withDuration:kAnimationDuration)
        { [weak self] in
            
            self?.layoutIfNeeded()
        }
    }
}
