0

I have: a big html string of an article which I load in a wkWebView like that:

[[self webView]loadHTMLString:htmlStr baseURL:nil];

I need to load css from web page where this article is located.

Article located here: https://vivreathenes.com/visiter-athenes-en-famille-le-nouveau-musee-de-l-enfant.html

I have no idea how I can do this so any help will be appreciated.

Artyom
  • 371
  • 1
  • 4
  • 14
  • 1
    I believe this is a duplicate of this question: https://stackoverflow.com/questions/33123093/insert-css-into-loaded-html-in-uiwebview-wkwebview – BHendricks Apr 12 '18 at 14:40
  • doesnt work for me – Artyom Apr 12 '18 at 15:37
  • Have you tried: `[[self webView]loadHTMLString:htmlStr baseURL:[NSURL URLWithString:@"https://vivreathenes.com/"]];` ? (I'm assuming your *"big html string"* contains the css hrefs) – DonMag Apr 12 '18 at 19:33
  • yes I did doesn't change anything – Artyom Apr 12 '18 at 19:56
  • OK - where are you getting your "big html string"? And does that string have the ` – DonMag Apr 13 '18 at 12:44
  • I get it from here: https://vivreathenes.com/wp-json/wp/v2/post-data/29457 No it doesn't have the string. – Artyom Apr 13 '18 at 12:56
  • 1
    OK - are you hoping to replicate the page as seen via your Article link? Or do you just want the font styles / colors? – DonMag Apr 13 '18 at 15:52
  • I have an article from the back end and I want to set it (only article nothing more) in a WkWebView exactly as this article looks in a webPage. – Artyom Apr 13 '18 at 21:24
  • The "post" html string you are getting doesn't have any css definitions in it. To get it to display anything like it looks when you go to that page, you'll have to get the css from somewhere else. – DonMag Apr 16 '18 at 14:24

0 Answers0