0

I get this response from the API

I pasted it on the link below.

https://docs.google.com/document/d/1gvkM_ajvmtpqRRbUXdcZxgTK0O-DmkWPlLkIs5CtwN4/edit?usp=sharing

It's an HTML String with Javascript.

I would like to load it using WebKitView.

But simply calling webView.loadHTMLString(htmlString, baseURL: nil) does not work.

3
  • 1
    see this stackoverflow.com/questions/41223699/… Commented May 15, 2018 at 12:32
  • Can you test the script locally? Because its not working on my macbook browser either. Commented May 15, 2018 at 12:35
  • It's a different case, they are loading an HTML file locally. I get mine from an API Response Commented May 15, 2018 at 12:38

1 Answer 1

0

Try this:

htmlString = htmlString.components(separatedBy: .whitespacesAndNewlines).joined()
webView.loadHTMLString(htmlString, baseURL: nil)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.