title: Get callback when UIWebView finishes loading Ajax
body: <p>Is it possible to get notified when Ajax has finished loading in UIWebView? In Android I was able to do it like this:</p>
  
  <pre><code>@SuppressLint("SetJavaScriptEnabled")
  private void setUpWebView() {
      webview = view.findViewById(R.id.webView);
      webview.getSettings().setJavaScriptEnabled(true);
      webview.addJavascriptInterface(new JavaScriptInterface(), "HtmlViewer");
      webview.setWebViewClient(new LoginWebView());
      webview.loadUrl("EXAMPLE URL");
  }
  
  private class LoginWebView extends WebViewClient {
      @SuppressLint({"JavascriptInterface"})
      @Override
      public void onPageFinished(WebView view, String url) {
          view.loadUrl("javascript:(function(){" +
              "\n" + "    jQuery(document).ajaxComplete(function(event, request, settings){" +
              "\n" + "        var responseCode = JSON.parse(request.responseText).result.responseCode;" +
              "\n" + "        window.HtmlViewer.ajaxResponse(settings.url, responseCode);" +
              "\n" + "    });" +
              "\n" + "})();";);
      }
  }
  
  private class JavaScriptInterface {
      @JavascriptInterface
      public void ajaxResponse(String url, String responseCode) {
          // Gets notified when Ajax finished loading
      }
  }
  </code></pre>
  
  <p>Now every time Ajax has finished loading, my <code>ajaxResponse</code> method is being called. Is it possible to achieve that also in UIWebView?</p>