This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/ios/samples/create-link-annotation-in-pdf.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Create link annotations in PDF using Swift for iOS

Shows how to only expose link annotations in the UI. Get additional resources by visiting our guide on adding link annotations to PDFs in iOS.


//
// Copyright © 2017-2026 PSPDFKit GmbH. All rights reserved.
//
// The Nutrient sample applications are licensed with a modified BSD license.
// Please see License for details. This notice may not be removed from this file.
//
import PSPDFKit
import PSPDFKitUI
class AnnotationLinkEditorExample: Example {
override init() {
super.init()
contentDescription = "Shows how to create link annotations."
category = .annotations
priority = 71
}
override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
let document = AssetLoader.document(for: .annualReport)
let controller = PDFViewController(document: document) {
// Only allow adding link annotations here
$0.editableAnnotationTypes = [.link]
}
return controller
}
}

This code sample is an example that illustrates how to use our SDK. Please adapt it to your specific use case.