<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URL/ParseStrategy/init(scheme:user:password:host:port:path:query:fragment:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation3URLV13ParseStrategyV6scheme4user8password4host4port4path5query8fragmentA2E09ComponentcD0Oy__SSG_A3pOy__SiGA3Ptcfc"
  },
  "title" : "init(scheme:user:password:host:port:path:query:fragment:)"
}
-->

# init(scheme:user:password:host:port:path:query:fragment:)

Creates a URL parse strategy with the specified component-parsing behaviors.

```
init(scheme: URL.ParseStrategy.ComponentParseStrategy<String> = .required, user: URL.ParseStrategy.ComponentParseStrategy<String> = .optional, password: URL.ParseStrategy.ComponentParseStrategy<String> = .optional, host: URL.ParseStrategy.ComponentParseStrategy<String> = .required, port: URL.ParseStrategy.ComponentParseStrategy<Int> = .optional, path: URL.ParseStrategy.ComponentParseStrategy<String> = .optional, query: URL.ParseStrategy.ComponentParseStrategy<String> = .optional, fragment: URL.ParseStrategy.ComponentParseStrategy<String> = .optional)
```

## Parameters

`scheme`

A strategy for parsing the scheme component.

`user`

A strategy for parsing the user component.

`password`

A strategy for parsing the password component.

`host`

A strategy for parsing the host component.

`port`

A strategy for parsing the port component.

`path`

A strategy for parsing the path component.

`query`

A strategy for parsing the query component.

`fragment`

A strategy for parsing the fragment component.

---

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)