 
     var keyboardInfo: KeyboardInfo? {
         willSet {
-            if UIApplication.sharedApplication().applicationState != .Active {
+            guard UIApplication.sharedApplication().applicationState != .Background else {
                 return
             }
 

    
    func keyboardWillChangeFrame(notification: NSNotification) {

        if UIApplication.sharedApplication().applicationState != .Active {
            return
        }



    func keyboardDidHide(notification: NSNotification) {

        guard UIApplication.sharedApplication().applicationState != .Background else {
            return
        }

