---
title: fragment
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurlcomponents/fragment
---

# fragment

The fragment URL component (the part after a # symbol), or nil if not present.

## Declaration

```swift
var fragment: String? { get set }
```

## Discussion

Discussion For example, in the URL http://www.example.com/index.html#jumpLocation, the fragment is jumpLocation.

## See Also

### Accessing components in native format

- [host](foundation/nsurlcomponents/host.md)
- [encodedHost](foundation/nsurlcomponents/encodedhost.md)
- [password](foundation/nsurlcomponents/password.md)
- [path](foundation/nsurlcomponents/path.md)
- [port](foundation/nsurlcomponents/port.md)
- [query](foundation/nsurlcomponents/query.md)
- [queryItems](foundation/nsurlcomponents/queryitems.md)
- [scheme](foundation/nsurlcomponents/scheme.md)
- [user](foundation/nsurlcomponents/user.md)
