Contents

setDestinationWithName(_:for:)

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

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