load(_:)
Loads the web content that the specified URL references and navigates to that content.
Declaration
@discardableResult @MainActor final func load(_ url: URL?) -> some AsyncSequence<WebPage.NavigationEvent, any Error>
Parameters
- url:
The URL to load. If this is
nil, an error will be immediately thrown from the returned sequence.
Return Value
An async sequence you use to track the loading progress of the navigation. If the Task enclosing the sequence is cancelled, the page will stop loading all resources.
Discussion
Use this method to load a page from a local or network-based URL. For example, you might use this method to navigate to a network-based webpage.