 
 extension KeyboardResponder where Self: UIViewController {
 
-    var keyboardHeight: NSLayoutConstraint? {
+    func keyboardHeight() -> NSLayoutConstraint? {
         return nil
     }
 

import UIKit

public protocol KeyboardResponder {
    var keyboardHeight: NSLayoutConstraint? { get }
    func keyboardWillChange(_ notif: Notification)
    func keyboardHeightDidUpdate(_ height: CGFloat)
}

            var kbRect = (info[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
            kbRect = view.convert(kbRect, from: view.window)
            let height = view.bounds.size.height - kbRect.origin.y
            if let constraint = keyboardHeight() {
                if constraint.constant != height {
                    print("Bottom layout constant = \(height)")
                    keyboardHeightDidUpdate(height)
