Trait WKURLSchemeHandler

Source
pub unsafe trait WKURLSchemeHandler: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn webView_startURLSchemeTask(
        &self,
        web_view: &WKWebView,
        url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
    )
       where Self: Sized + Message { ... }
    unsafe fn webView_stopURLSchemeTask(
        &self,
        web_view: &WKWebView,
        url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature WKURLSchemeHandler only.
Expand description

A class conforming to the WKURLSchemeHandler protocol provides methods for loading resources with URL schemes that WebKit doesn’t know how to handle itself.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn webView_startURLSchemeTask( &self, web_view: &WKWebView, url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>, )
where Self: Sized + Message,

Available on crate feature WKURLSchemeTask and crate feature WKWebView and crate feature objc2-app-kit and macOS only.

Notifies your app to start loading the data for a particular resource represented by the URL scheme handler task.

Parameter webView: The web view invoking the method.

Parameter urlSchemeTask: The task that your app should start loading data for.

Source

unsafe fn webView_stopURLSchemeTask( &self, web_view: &WKWebView, url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>, )
where Self: Sized + Message,

Available on crate feature WKURLSchemeTask and crate feature WKWebView and crate feature objc2-app-kit and macOS only.

Notifies your app to stop handling a URL scheme handler task.

Parameter webView: The web view invoking the method.

Parameter urlSchemeTask: The task that your app should stop handling.

After your app is told to stop loading data for a URL scheme handler task it must not perform any callbacks for that task. An exception will be thrown if any callbacks are made on the URL scheme handler task after your app has been told to stop loading for it.

Trait Implementations§

Source§

impl ProtocolType for dyn WKURLSchemeHandler

Source§

const NAME: &'static str = "WKURLSchemeHandler"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn WKURLSchemeHandler

Implementations on Foreign Types§

Source§

impl<T> WKURLSchemeHandler for ProtocolObject<T>

Implementors§