Instance Method


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


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



The handler to register.


The URL scheme the object handles.


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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software