---
title: scheme
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurl/scheme
---

# scheme

The scheme. (read-only)

## Declaration

```swift
var scheme: String? { get }
```

## Discussion

Discussion This property contains the scheme. Any percent-encoded characters are not unescaped. For example, in the URL http://www.example.com/index.html, the scheme is http. The full URL is the concatenation of the scheme, a colon (:), and the value of resourceSpecifier. note: The term “protocol” is also sometimes used when talking about network-based URL schemes. However, not all URL schemes are networking protocols—data:// URLs, for example.

## See Also

### Accessing the Parts of the URL

- [absoluteString](foundation/nsurl/absolutestring.md)
- [absoluteURL](foundation/nsurl/absoluteurl.md)
- [baseURL](foundation/nsurl/baseurl.md)
- [fileSystemRepresentation](foundation/nsurl/filesystemrepresentation.md)
- [fragment](foundation/nsurl/fragment.md)
- [host](foundation/nsurl/host.md)
- [lastPathComponent](foundation/nsurl/lastpathcomponent.md)
- [parameterString](foundation/nsurl/parameterstring.md)
- [password](foundation/nsurl/password.md)
- [path](foundation/nsurl/path.md)
- [pathComponents](foundation/nsurl/pathcomponents.md)
- [pathExtension](foundation/nsurl/pathextension.md)
- [port](foundation/nsurl/port.md)
- [query](foundation/nsurl/query.md)
- [relativePath](foundation/nsurl/relativepath.md)
