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

Disable bookmark editing using Document Features. Get additional resources by visiting our guides on PDF Document Features.


//
// Copyright © 2018-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 DisableBookmarkEditingExample: Example {
override init() {
super.init()
contentDescription = "Shows how to disable bookmark editing using Document Features"
category = .subclassing
priority = 260
}
override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController {
let document = AssetLoader.writableDocument(for: .welcome, overrideIfExists: false)
// Add the custom source to the document's features.
let documentFeaturesSource = DisableBookmarkEditingDocumentFeaturesSource()
document.features.add([documentFeaturesSource])
let controller = PDFViewController(document: document)
controller.navigationItem.setRightBarButtonItems([controller.outlineButtonItem], animated: false)
return controller
}
}
private class DisableBookmarkEditingDocumentFeaturesSource: NSObject, PDFDocumentFeaturesSource {
weak var features: PDFDocumentFeatures?
// Return false to disable bookmark editing.
var canEditBookmarks: Bool {
false
}
}

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