---
title: "urlSchemeHandler(forURLScheme:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebviewconfiguration/urlschemehandler(forurlscheme:)"
---

# urlSchemeHandler(forURLScheme:)

Returns the currently registered handler object for the specified URL scheme.

## Declaration

```swift
func urlSchemeHandler(forURLScheme urlScheme: String) -> (any WKURLSchemeHandler)?
```

## Parameters

- `urlScheme`: The scheme to look up. Scheme names are case sensitive, must start with an ASCII letter, and may contain only ASCII letters, numbers, the “+” character, the “-” character, and the “.” character. If this parameter contains an empty string or the scheme name includes invalid characters, this method returns nil.

## Return Value

Return Value The handler object for the specified scheme, or nil if the scheme has no handler.

## See Also

### Adding handlers for custom URL schemes

- [setURLSchemeHandler(_:forURLScheme:)](webkit/wkwebviewconfiguration/seturlschemehandler(_:forurlscheme:).md)
