PDF Reflow with Reader View in Swift for iOS
Show the Reader View, which reformats document text for easy reading. Get additional resources by visiting our iOS PDF reader library.
//// Copyright © 2020-2025 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 PSPDFKitimport PSPDFKitUI
class ReaderViewExample: Example {
override init() { super.init()
self.title = "Reader View" self.contentDescription = "Shows Reader View, which reformats document text for easy reading." self.category = .componentsExamples self.priority = 2 }
override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController {
let document = AssetLoader.document(for: .cosmicContextForLife) let controller = PDFViewController(document: document)
controller.navigationItem.rightBarButtonItems = [controller.thumbnailsButtonItem, controller.readerViewButtonItem]
return controller }}
This code sample is an example that illustrates how to use our SDK. Please adapt it to your specific use case.