Contents

loadHTMLString(_:baseURL:)

Loads the contents of the specified HTML string and navigates to it.

Declaration

func loadHTMLString(_ string: String, baseURL: URL?) -> WKNavigation?

Parameters

  • string:

    The string to use as the contents of the webpage.

  • baseURL:

    The base URL to use when the system resolves relative URLs within the HTML string.

Return Value

A new navigation object you use to track the loading progress of the request.

Discussion

Use this method to navigate to a webpage that you loaded or created yourself. For example, you might use this method to load HTML content that your app generates programmatically.

This method sets the source of this load request for app activity data to NSURLRequest.Attribution.developer.

See Also

Loading web content