Skip Navigation
Instance MethodMethod

destination(forPage:depth:)

Returns the destination of a link to a page.

func destination(
    forPage url: String,
    depth: Int
) -> String?

Parameters

url

The DocC URL of the page, such as /documentation/module/symbol or /documentation/module/article#heading; URLs with a scheme and fragments of the current page are returned unchanged.

depth

The number of directories between the output root and the page that contains the link.

Return Value

A relative link to a generated page, an absolute link to a page of external documentation, or nil if the page is neither.