Instance Method
withFragment(_:)
Creates a new topic reference with the given fragment.
func withFragment(_ fragment: String?) -> ResolvedTopicReference
Parameters
fragmentThe new fragment.
Return Value
The resulting topic reference.
Discussion
Before adding the fragment to the reference, the fragment is encoded in a human readable format that avoids percent escape encoding in the URL.
You use a fragment to reference an element within a page:
doc://your.bundle.identifier/path/to/page#element-in-page
╰──────┬──────╯
fragment
On-page elements can then be linked to using a fragment need to conform to the Landmark protocol.