Instance Method

setDestinationWithName(_:for:)

Creates a link rectangle in the current page that when clicked, will jump the PDF viewer to the named destination.

Declaration

func setDestinationWithName(_ name: String, for rect: CGRect)

Parameters

name

The name of the destination point to which the PDF viewer jumps.

rect

The region on the current page that becomes the active link area, specified in points in the PDF coordinate space.

Discussion

Use this method in conjunction with the addDestination(withName:at:) method to create internal links within a PDF. This method represents the creation of the links that, when clicked, jump the user to a named destination, created using the addDestination(withName:at:) method.

For an example of how to use internal links, including mapping between coordinate spaces, see Creating Internal Links in UIGraphicsPDFRenderer.

See Also

Managing Destinations

func addDestination(withName: String, at: CGPoint)

Creates a named destination point in the current PDF page.

func setURL(URL, for: CGRect)

Creates a link to an external resource defined by a URL