This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/ios/samples/customized-note-annotation-view-controller.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Customized note annotation view controller in Swift for iOS

Customize PSPDFNoteAnnotationViewController to hide the Note timestamp and author labels. Get additional resources by visiting our PSPDFNoteAnnotationViewController API guide.


//
// 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 CustomizedNoteAnnotationViewControllerExample: Example {
override init() {
super.init()
title = "Customized PSPDFNoteAnnotationViewController"
category = .annotations
priority = 400
wantsModalPresentation = true
}
override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
let noteAnnotation = NoteAnnotation()
// width/height will be ignored for note annotations.
noteAnnotation.boundingBox = CGRect(x: 100, y: 100, width: 32, height: 32)
noteAnnotation.contents = "This is a sample note."
let noteViewController = CustomPSPDFNoteAnnotationViewController(annotation: noteAnnotation)
noteViewController.backgroundView.backgroundColor = .red
noteViewController.commentBackgroundColor = .yellow
noteViewController.showsTimestamps = false
noteViewController.showsAuthorName = false
return noteViewController
}
class CustomPSPDFNoteAnnotationViewController: NoteAnnotationViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(dismissModal))
}
@objc func dismissModal() {
self.dismiss(animated: true, completion: nil)
}
}
}

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