Instance Method

setURLSchemeHandler:forURLScheme:

Adds a URL scheme handler object for a given URL scheme.

Declaration

- (void)setURLSchemeHandler:(id<WKURLSchemeHandler>)urlSchemeHandler forURLScheme:(NSString *)urlScheme;

Parameters

urlSchemeHandler

The handler to register.

scheme

The URL scheme the object handles.

Discussion

Each URL scheme can only have one handler. An exception is thrown if you register a handler for an invalid URL scheme, if you register a handler for a URL scheme more than once, or if you register a handler for a URL scheme already handled by WebKit. You can call the handlesURLScheme: method to determine whether WebKit handles a particular URLs scheme.URL schemes are case insensitive. Valid URL schemes must start with an ASCII letter and can only contain ASCII letters, numbers, the '+' character, the '-' character, and the '.' character.

See Also

Adding Handlers for New URL Schemes

- urlSchemeHandlerForURLScheme:

Returns the currently registered scheme handler for the given URL scheme