Google reCaptcha. How to handle click on checkmark

Viewed 41

I need to increase my view if images appear in the captcha. And decrease when the answers are valid. How can I track that the pictures have appeared with Swift in IOS?

enter image description here

func addViewForCaptcha() {
    let viewForWebView = UIView()
    self.view.addSubview(viewForWebView)
    guard let reCaptchaVM = reCaptchaVM else { return }
    
    let webConfiguration = WKWebViewConfiguration()
    let contentController = WKUserContentController()
    
    contentController.add(reCaptchaVM, name: "recaptcha")
    webConfiguration.userContentController = contentController
    let webView = WKWebView(frame: viewForWebView.bounds, configuration: webConfiguration)
    webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    webView.loadHTMLString(reCaptchaVM.html, baseURL: reCaptchaVM.url)
    viewForWebView.addSubview(webView)
    
    viewForWebView.translatesAutoresizingMaskIntoConstraints = false
    NSLayoutConstraint.activate([
        viewForWebView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 25),
        viewForWebView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -25),
        viewForWebView.topAnchor.constraint(equalTo: checkMarkStackView.bottomAnchor, constant: 40),
        viewForWebView.bottomAnchor.constraint(equalTo: signUpButton.topAnchor, constant: -40),
        viewForWebView.heightAnchor.constraint(equalToConstant: 90)
    ])
}
0 Answers
Related