---
title: "scheme(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/url/parsestrategy/scheme(_:)"
---

# scheme(_:)

Modifies a parse strategy to parse a URL’s scheme component in accordance with the provided behavior.

## Declaration

```swift
func scheme(_ strategy: URL.ParseStrategy.ComponentParseStrategy<String> = .required) -> URL.ParseStrategy
```

## Parameters

- `strategy`: A strategy for parsing the scheme component.

## Return Value

Return Value A modified URL.ParseStrategy that incorporates the specified behavior.

## See Also

### Customizing strategy behavior

- [user(_:)](foundation/url/parsestrategy/user(_:).md)
- [password(_:)](foundation/url/parsestrategy/password(_:).md)
- [host(_:)](foundation/url/parsestrategy/host(_:).md)
- [port(_:)](foundation/url/parsestrategy/port(_:).md)
- [path(_:)](foundation/url/parsestrategy/path(_:).md)
- [query(_:)](foundation/url/parsestrategy/query(_:).md)
- [fragment(_:)](foundation/url/parsestrategy/fragment(_:).md)
- [URL.ParseStrategy.ComponentParseStrategy](foundation/url/parsestrategy/componentparsestrategy.md)
