<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/URLScheme/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "s:6WebKit9URLSchemeVyACSgSScfc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Creates a new `URLScheme` value from a valid scheme, which WebKit does not already handle.

```
@MainActor init?(_ rawValue: String)
```

## Parameters

`rawValue`

The raw value of the scheme string; if this is an invalid scheme, of if WebKit already handles
this scheme, the initializer returns `nil`.

## Discussion

To determine whether WebKit handles a specific scheme, call the `handlesURLScheme(_:)` static method of `WebPage`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)