 
   override func viewWillAppear(_ animated: Bool) {
     super.viewWillAppear(animated)
+    self.userContentController.add(self, name: keymanWebViewName)
   }
   
   // Very useful for immediately adjusting the WebView's properties upon loading.

    prefs.javaScriptEnabled = true
    config.preferences = prefs
    config.suppressesIncrementalRendering = false

    let userContentController = WKUserContentController()
    userContentController.add(self, name: "keyman")
    config.userContentController = userContentController

    webView = KeymanWebView(frame: CGRect(origin: .zero, size: keyboardSize), configuration: config)
    webView!.isOpaque = false
    webView!.translatesAutoresizingMaskIntoConstraints = false

    // Initialize the keyboard's size/scale.  In iOS 13 (at least), the system
    // keyboard's width will be set at this stage, but not in viewWillAppear.
    keyboardSize = view.bounds.size
  }
  
  override func viewWillDisappear(_ animated: Bool) {
    self.userContentController.removeScriptMessageHandler(forName: keymanWebViewName)
  }
}

