---
title: "init(scheme:user:password:host:port:path:query:fragment:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/url/parsestrategy/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.

## Declaration

```swift
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.

## See Also

### Creating a URL parse strategy

- [URL.ParseStrategy.ComponentParseStrategy](foundation/url/parsestrategy/componentparsestrategy.md)
