             buttonViewHeightConstraint.constant = buttonView.contentSize.height
         }
         
-        let backgroundViewHeight = view.bounds.size.height - keyboardHeight
+        let backgroundViewHeight = view.bounds.size.height - backgroundViewBottomSpaceConstraint.constant
         if buttonViewHeightConstraint.constant > backgroundViewHeight {
             buttonView.contentSize.height = buttonViewHeightConstraint.constant
             buttonViewHeightConstraint.constant = backgroundViewHeight

    let ButtonFontSize: CGFloat = 17
    var animator: UIDynamicAnimator?
    var presentedAnimation: Bool = true
    var keyboardHeight: CGFloat = 0
    
    var message: String?
    

        modalTransitionStyle = .CrossDissolve
        transitioningDelegate = self
        
        NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil)
    }
    
    public override func viewDidLoad() {
