This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/ios/samples/custom-thumbnail-page-label.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Customize thumbnail page labels

Customize page labels in the thumbnails view mode.


//
// Copyright © 2021-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 CustomThumbnailPageLabelExample: Example {
override init() {
super.init()
contentDescription = "Shows how to customize page labels in the thumbnails view mode."
category = .controllerCustomization
priority = 10
}
override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
// Set custom appearance only to the custom subclass so that we don't
// override all examples here. In your code, you can use ThumbnailGridViewCell.
let appearance = RoundedLabel.appearance(whenContainedInInstancesOf: [CustomThumbnailGridViewCell.self])
appearance.rectColor = UIColor.systemGreen.withAlphaComponent(0.8)
appearance.cornerRadius = 20
// Register our custom cell as a subclass.
let controller = PDFViewController(document: AssetLoader.document(for: .welcome)) {
$0.overrideClass(ThumbnailGridViewCell.self, with: CustomThumbnailGridViewCell.self)
}
// Switch to the thumbnails mode immediately.
controller.viewMode = .thumbnails
return controller
}
}
private class CustomThumbnailGridViewCell: ThumbnailGridViewCell {
override func updatePageLabel() {
super.updatePageLabel()
// You can customize the page label here as well.
if let fontDescriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: .body).withDesign(.monospaced) {
self.pageLabel.font = UIFont(descriptor: fontDescriptor, size: 0)
}
}
}

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