M1X
M1X

Reputation: 5354

UIWebView HTML is displayed as text

I want to display some HTML content inside a UIWebView. The problem is that the response is being displayed as plain text and HTML is not rendered at all.

@IBOutlet weak var related: UIWebView!

override func viewDidLoad() {
        super.viewDidLoad()
        related.delegate = self

        related.loadRequest(URLRequest(url: URL(string: "https://kida.al/api/related_iOS.php?video_name=uhbaby")!))
}

This is what I get inside UIWebView

enter image description here

Upvotes: 0

Views: 227

Answers (1)

toddg
toddg

Reputation: 2906

Do you own this server? Looks like the page content isn't being sent properly. The HTML is not rendered when you hit that URL in a web browser either:

enter image description here

Upvotes: 1

Related Questions