Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
wkwebview no detecta números de teléfono al cargar el contenido html usando javascript

wkdatdetectortypes = .all no detecta ninguno de los datos como números de teléfono, direcciones, etc. en wkwebview. Esto sucede solo cuando se carga la cadena html usando javascript. Si se hace mediante loadHTMLString, los datos se detectan correctamente. alguien me puede ayudar al respecto. gracias.

aquí está mi código de referencia:

 let config = WKWebViewConfiguration() config.dataDetectorTypes = [WKDataDetectorTypes.all] webview = WKWebView(frame: .zero, configuration: config) webview.isUserInteractionEnabled = true webview.backgroundColor = .white webview.navigationDelegate = self webview.uiDelegate = self webview.allowsLinkPreview = true webview.translatesAutoresizingMaskIntoConstraints = false let bundleURL = Bundle.main.resourceURL!.absoluteURL let html = bundleURL.appendingPathComponent("index.html") //index.html is in the same project file path. webview.loadFileURL(html, allowingReadAccessTo:bundleURL) let testString = "My contact number is: 1243233423"

// cargando la cadena html usando javascript.

 let stringToBeLoaded = "var text=\"\(testString)\";showText(text); //showText() is a method in the index.html file to set the content. webview.evaluateJavaScript(stringToBeLoaded, completionHandler: nil) //Doing this way is not detecting the phone number

// cargando la cadena html

 webview.loadHTMLString(testString, baseURL: nil) //Doing this way is identifying the phone number and converting it to a clickable link from which I can call to this number.
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!