     */
     func keyboardDidShow(notification: NSNotification) {
         
+        let info  = notification.userInfo!
+        
+        keyboardAnimationDuration = info[UIKeyboardAnimationDurationUserInfoKey]!.doubleValue
+        keyboardAnimationCurve = UInt(info[UIKeyboardAnimationCurveUserInfoKey]!.intValue)
+        
         let frame = getKeyboardFrame(notification)
+        
+        if frame.h == 0 {
+            return
+        }
         
         var button: UIButton!
         if let btn = hideKeyboardButton {
             btn.removeFromSuperview()
         }
-
+        
         button = UIButton(frame: CGRectMake(frame.w - hideKeyboardButtonWidth, frame.y - hideKeyboardButtonHeight, hideKeyboardButtonWidth, hideKeyboardButtonHeight))
         button.setTitle("hide", forState: UIControlState.Normal)
         button.backgroundColor = UIColor(red: 173.0/255.0, green: 181.0/255.0, blue: 189.0/255.0, alpha: 1)

        return (x,y,w,h)
    }
    
    /**
    onHideKeyboardButtonClick
    
    - parameter sender: sender
    */
    func onHideKeyboardButtonClick(sender: UIButton) {
        if let btn = hideKeyboardButton {
            btn.alpha = 0
            btn.removeFromSuperview()
        }
        self.view.endEditing(false)
    }

    - parameter notification: notification
    */
    func keyboardWillHide(notification: NSNotification) {
        
        if hidingKeyboardFlag {
            hidingKeyboardFlag = false
            return
        }
        
        if let btn = hideKeyboardButton {
            btn.alpha = 0
            btn.removeFromSuperview()
