     prefs.javaScriptEnabled = true
     config.preferences = prefs
     config.suppressesIncrementalRendering = false
-
-    let userContentController = WKUserContentController()
-    userContentController.add(self, name: "keyman")
-    config.userContentController = userContentController
-
+    config.userContentController = self.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 viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    self.userContentController.add(self, name: keymanWebViewName)
  }
  
  // Very useful for immediately adjusting the WebView's properties upon loading.
