---
title: "Display PDF annotations on layers in Swift for iOS"
canonical_url: "https://www.nutrient.io/guides/ios/samples/pdf-annotation-layers/"
md_url: "https://www.nutrient.io/guides/ios/samples/pdf-annotation-layers.md"
last_updated: "2026-05-25T12:14:42.940Z"
description: "Discover how to use Instant’s Layers feature for PDF document annotations. Visit our guide for iOS resources and a practical example in Swift."
---

# Display PDF annotations on layers in Swift for iOS

Use Instant’s Layers feature to display different sets of annotations on a document. Get additional resources by visiting our guide on [creating PDF annotation layers in iOS](/guides/ios/pspdfkit-instant/instant-layers.md).

[Get Started](https://www.nutrient.io/sdk/ios/getting-started.md)

[All Samples](https://www.nutrient.io/guides/ios/samples.md)

[Download](https://www.nutrient.io/guides/ios/downloads.md)

[Launch Demo](https://www.nutrient.io/demo/)

---

```swift

//
//  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 Instant
import PSPDFKit
import PSPDFKitUI

class InstantLayersExample: Example {

    override init() {
        super.init()

        title = "Instant Layers Example"
        contentDescription = "Shows how to display different sets of annotations on a document using Instant Layers."
        category =.collaboration
        priority = 3

        wantsModalPresentation = true
        embedModalInNavigationController = false
    }

    weak var presentingViewController: UIViewController?

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let currentViewController = delegate.currentViewController!
        presentNewSession(on: currentViewController)
        presentingViewController = currentViewController

        return nil
    }

    /// Connects to the Example API Client to get the document info for the current example
    /// and then displays that document in a `InstantViewController`.
    func presentNewSession(on viewController: UIViewController) {
        // URL of the client server (your server) that has the list of documents the particular user can access.
        // See https://www.nutrient.io/guides/ios/instant-synchronization/ for more details.
        let apiClient = WebExamplesAPIClient(delegate: self)

        let progressHUDItem = StatusHUDItem.indeterminateProgress(withText: "Creating")
        progressHUDItem.setHUDStyle(.black)

        // Append UUID to the layer names to create unique layers for each session.
        let sessionUUID = UUID().uuidString
        let layerNames = ["Review-1", "Review-2", "Review-3"].map { $0.appending(sessionUUID) }

        progressHUDItem.push(animated: true, on: viewController.view.window) {
            // Ask your server to create a new session for the given user and the specified document identifier.
            // It should ideally provide a signed JWT (and the Nutrient Document Engine if not already available)
            // that can be used by the `InstantClient` to access and download the document for iOS.
            apiClient.createNewSession(with: layerNames) { result in
                DispatchQueue.main.async {
                    progressHUDItem.pop(animated: true, completion: nil)

                    switch result {
                    case let.success(documentLayers):
                        // Process the instant document layers to remove the appended unique identifier
                        // from the layer name so the name is a human readable label.
                        var processedLayers = [String: InstantDocumentInfo]()
                        for (key, value) in documentLayers {
                            let processedKey = key.replacingOccurrences(of: sessionUUID, with: "")
                            processedLayers[processedKey] = value
                        }
                        self.presentInstantViewController(for: processedLayers, on: viewController)
                    case let.failure(error):
                        viewController.showAlert(withTitle: "Couldn’t Get Instant Document Info", message: error.localizedDescription)
                    }
                }
            }
        }
    }

    private func presentInstantViewController(for documentLayers: [String: InstantDocumentInfo], on viewController: UIViewController) {
        let instantViewController = MultipleInstantLayersContainerViewController(documentLayers: documentLayers)
        instantViewController.modalPresentationStyle =.fullScreen
        viewController.present(instantViewController, animated: true)
    }

}

private class MultipleInstantLayersContainerViewController: UIViewController, UISplitViewControllerDelegate {

    // MARK: Properties

    /// Controller containing the Instant Layers listing and the Document view.
    private var containedSplitViewController: UISplitViewController

    /// Controller displaying the Instant Document in the content view of the split view controller.
    var instantController: ContainedInstantDocumentViewController

    /// Controller displaying the list of available Instant Layers in the sidebar of the split view controller.
    var instantLayersListController: InstantLayersListViewController

    /// Controller added as the sidebar. Adds `instantLayersListController` as a child controller.
    var sidebarContainerController: SidebarControllersContainingViewController

    /// Button displayed in the navigation bar to show/hide the sidebar.
    private lazy var sidebarToggleButton: UIBarButtonItem = {
        let sidebarToggleIconImage = PSPDFKit.SDK.imageNamed("document_outline")
        let button = UIBarButtonItem(image: sidebarToggleIconImage, style:.plain, target: self, action: #selector(togglesSidebar(_:)))

        button.title = "Document Layers"
        return button
    }()

    init(documentLayers: [String: InstantDocumentInfo]) {
        instantLayersListController = InstantLayersListViewController(documentLayers: documentLayers)
        instantLayersListController.title = "Layers"

        // Upon initialization `InstantLayersListViewController` defaults to the first layer.
        // This is why we use `selectedLayerName` to access the first layer to display.
        let selectedLayerName = instantLayersListController.selectedLayerName
        instantController = ContainedInstantDocumentViewController(documentInfo: documentLayers[selectedLayerName]!)
        instantController.title = "Instant Layers Example"

        // `instantLayersListController` instance needs to know if a new session was started by
        // the `instantController` so that it can add the new session layer to the listing.
        instantController.documentInfoSessionDelegate = instantLayersListController

        sidebarContainerController = SidebarControllersContainingViewController(childViewController: instantLayersListController)

        let sidebarController = PDFNavigationController(rootViewController: sidebarContainerController)
        let contentController = PDFNavigationController(rootViewController: instantController)

        // Create a `UISplitViewController` with the above controllers.
        let splitController = UISplitViewController(style:.doubleColumn)
        splitController.setViewController(sidebarController, for:.primary)
        splitController.setViewController(contentController, for:.secondary)

        splitController.preferredDisplayMode =.oneBesideSecondary
        containedSplitViewController = splitController

        // We want to disable showing the `displayModeButton` so we can use our custom button to toggle sidebar.
        // Disabling gestures also disables showing the `displayModeButton`.
        // For consistency we disable gestures on both.
#if!os(visionOS)

        splitController.presentsWithGesture = false
#endif

        super.init(nibName: nil, bundle: nil)

        // Assign the `instantController` as the delegate of the `InstantLayersListViewController`
        // so the `instantController` instance can update the document layer it is presenting.
        instantLayersListController.delegate = self

        // We add our own bar button item to toggle the sidebar to get our desired sidebar behavior.
        instantController.navigationItem.setLeftBarButtonItems([sidebarToggleButton], for:.document, animated: false)
        instantController.navigationItem.setRightBarButtonItems([instantController.exampleCloseButtonItem, instantController.annotationButtonItem, instantController.collaborateButtonItem], for:.document, animated: false)
    }

    @available(*, unavailable)
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        addChild(containedSplitViewController)
        view.addSubview(containedSplitViewController.view)
        containedSplitViewController.didMove(toParent: self)

        containedSplitViewController.view.translatesAutoresizingMaskIntoConstraints = false
        NSLayoutConstraint.activate([
            containedSplitViewController.view.topAnchor.constraint(equalTo: view.topAnchor),
            containedSplitViewController.view.leftAnchor.constraint(equalTo: view.leftAnchor),
            containedSplitViewController.view.rightAnchor.constraint(equalTo: view.rightAnchor),
            containedSplitViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor)
        ])
    }

    /// Shows or hides the sidebar based on its current state.
    @objc func togglesSidebar(_ sender: Any?) {
        // Check whether there's enough space for sidebar to expand.
        if!containedSplitViewController.isCollapsed {
            let currentDisplayMode = containedSplitViewController.displayMode

            /// Whether the sidebar is already visible or not.
            let showSidebar: Bool
#if os(visionOS)

            showSidebar = currentDisplayMode!=.oneBesideSecondary
#else

            showSidebar =!(currentDisplayMode ==.oneOverSecondary || currentDisplayMode ==.oneBesideSecondary)
#endif

            sidebarContainerController.addContainedViewControllerIfNecessary()

            // We will use the modern API to show/hide the sidebar column (`.primary`).
            if showSidebar {
                self.containedSplitViewController.show(.primary)
            } else {
                self.containedSplitViewController.hide(.primary)
            }
        } else {
            // If the sidebar cannot be expanded then that means we are in compact width.
            // So we will have to present the controller presented in the sidebar modally.
            sidebarContainerController.presentContainedViewControllerModally(on: instantController)
        }
    }

    func ensureDocumentViewIsShown() {
        let isInOneOverSecondary: Bool
#if os(visionOS)

        isInOneOverSecondary = false
#else

        isInOneOverSecondary = containedSplitViewController.displayMode ==.oneOverSecondary
#endif

        if!containedSplitViewController.isCollapsed && isInOneOverSecondary {
            containedSplitViewController.show(.secondary)
        }
    }

}

extension MultipleInstantLayersContainerViewController: InstantLayersListViewControllerDelegate {

    func instantLayersListController(_ instantLayersListController: InstantLayersListViewController, didSelectLayer selectedLayer: InstantDocumentInfo, selectedLayerIndex: UInt) {
        // Change the document displayed by the instant controller to correspond to the corresponding
        // document of the selected layer name in the Layers list.
        instantController.changeVisibleDocument(to: selectedLayer, clearLocalStorage: false)
        instantController.displayingLayerIndex = selectedLayerIndex
        ensureDocumentViewIsShown()
    }
}

/// `InstantDocumentViewController` subclass that preloads the document with annotations
/// upon download.
private class ContainedInstantDocumentViewController: InstantDocumentViewController {

    override init(documentInfo: InstantDocumentInfo, lastViewedDocumentInfoKey: String? = nil) {
        super.init(documentInfo: documentInfo, lastViewedDocumentInfoKey: lastViewedDocumentInfoKey)

        // We don't want to allow creating new sessions for this document and the example.
        collaborationOptionsConfiguration = InstantCollaborationOptionsViewControllerConfiguration(
            documentIdentifierForNewSession: documentInfo.documentId,
            allowJoiningExistingSessions: true,
            allowCreatingNewSessions: false,
            allowsOpeningArbitraryDocuments: false
        )
    }

    /// Index of the Selected Layer corresponding to the `InstantLayersListViewController` instance.
    var displayingLayerIndex: UInt = 0

    /// Backing store of the indexes of the document layers that have had annotation preloaded.
    var preloadedLayerIndexes: Set<UInt> = []

    override func didFinishDownload(for documentInfo: InstantDocumentInfo) {
        // Add some default annotations to distinguish between the different layers.
        // We add these annotations when the downloading of the document has been completed.
        if!preloadedLayerIndexes.contains(displayingLayerIndex) {
            let preloadedAnnotations = InstantLayersExampleAnnotationsHelper.annotationsForLayer(at: displayingLayerIndex)
            document?.add(annotations: preloadedAnnotations)
            preloadedLayerIndexes.insert(displayingLayerIndex)
        }
    }

}

private protocol InstantLayersListViewControllerDelegate: AnyObject {

    /// `InstantDocumentInfo` of the layer selected from the list of layers presented by the `InstantLayersListViewController`.
    func instantLayersListController(_ instantLayersListController: InstantLayersListViewController, didSelectLayer selectedLayer: InstantDocumentInfo, selectedLayerIndex: UInt)
}

/// Displays a list of the available layers for the ongoing session shown in the sidebar for the
/// Instant Layers Example.
/// The list allows selecting between the available layers and passing on that information to its delegate.
/// In this example, the delegate is the `InstantViewController` subclass that will update the document it is
/// editing to the document selected in the list.
private class InstantLayersListViewController: UITableViewController, InstantDocumentViewControllerDelegate {

    /// Backing store of `InstantDocumentInfo` for the document layers to be listed stored against
    /// the layer name as their key.
    private(set) var documentLayers: [String: InstantDocumentInfo] {
        didSet {
            layerNames = Array(documentLayers.keys.sorted())
        }
    }

    /// Layer names listed by the controller.
    /// Convenience access for the sorted keys of `documentLayers`.
    private(set) var layerNames: [String]

    /// Index of the selected layer name.
    private(set) var selectedLayerIndex = 0

    var selectedLayerName: String {
        layerNames[selectedLayerIndex]
    }

    weak var delegate: InstantLayersListViewControllerDelegate?

    init(documentLayers: [String: InstantDocumentInfo]) {
        self.documentLayers = documentLayers
        self.layerNames = Array(documentLayers.keys.sorted())

        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    let cellIdentifier = "InstantLayerCellIdentifier"

    override func viewDidLoad() {
        super.viewDidLoad()

        tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier)
        tableView.tableFooterView = UIView()
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        let indexPath = IndexPath(row: selectedLayerIndex, section: 0)
        tableView.selectRow(at: indexPath, animated: false, scrollPosition:.none)
    }

    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        tableView.deselectRow(at: (IndexPath(row: selectedLayerIndex, section: 0)), animated: false)
    }

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        layerNames.count
    }

    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath)
        cell.selectedBackgroundView = UIView()
        cell.selectedBackgroundView?.backgroundColor =.systemBlue
        cell.textLabel?.text = layerNames[indexPath.row]
        cell.textLabel?.highlightedTextColor =.white
        return cell
    }

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        selectedLayerIndex = indexPath.row
        let selectedLayerName = layerNames[selectedLayerIndex]
        let selectedLayer = documentLayers[selectedLayerName]!
        delegate?.instantLayersListController(self, didSelectLayer: selectedLayer, selectedLayerIndex: UInt(selectedLayerIndex))

        // Dismiss the list if it is presented as a modal individually i.e not in a `splitViewController`.
        if splitViewController == nil {
            dismiss(animated: true)
        }
    }

    func instantDocumentController(_ instantDocumentController: InstantDocumentViewController, didCreateNewSession documentInfo: InstantDocumentInfo) {
        let layerCount = layerNames.count
        let newLayerName = "Review-\(layerCount + 1)"
        documentLayers[newLayerName] = documentInfo
        tableView.reloadData()

        selectedLayerIndex = layerCount
        let indexPath = IndexPath(row: selectedLayerIndex, section: 0)
        tableView.selectRow(at: indexPath, animated: true, scrollPosition:.none)
    }
}

extension InstantLayersExample: WebExamplesAPIClientDelegate {

    func examplesAPIClient(_ apiClient: WebExamplesAPIClient, didReceiveBasicAuthenticationChallenge challenge: URLAuthenticationChallenge, completion: @escaping (URLCredential?) -> Void) {
        presentingViewController?.presentBasicAuthPrompt(for: challenge) { username, password in
            guard let user = username,
                  let pass = password else {
                completion(nil)
                return
            }

            let urlCredential = URLCredential(user: user, password: pass, persistence:.permanent)
            completion(urlCredential)
        }
    }

}

// MARK: - Preloading Annotations Helper

/// A wrapper for the helper functions which create annotations
/// that are used by the InstantLayerExample to preload the different
/// layers with annotations.
private struct InstantLayersExampleAnnotationsHelper {

    static func annotationsForLayer(at index: UInt) -> [Annotation] {
        switch index {
        case 0:
            return annotationsForLayer1()
        case 1:
            return annotationsForLayer2()
        case 2:
            return annotationsForLayer3()
        default:
            return annotationsForLayer1()
        }
    }

    private static func annotationsForLayer1() -> [Annotation] {
        var annotations = [Annotation]()

        let draftStamp = StampAnnotation(stampType:.draft)
        draftStamp.boundingBox = CGRect(x: 1065, y: 421, width: 90, height: 21)
        annotations.append(draftStamp)

        let noteAnnotation = NoteAnnotation(contents: "I like the choice of bio degradable lighting.")
        noteAnnotation.color =.red
        noteAnnotation.boundingBox = CGRect(x: 240, y: 620, width: 32, height: 32)
        annotations.append(noteAnnotation)

        let freeTextAnnotation = FreeTextAnnotation(contents: "We need lighting in the hallway as well")
        freeTextAnnotation.color =.red
        freeTextAnnotation.boundingBox = CGRect(x: 592, y: 495, width: 97, height: 32)
        freeTextAnnotation.fontSize = 9
        annotations.append(freeTextAnnotation)

        let lineAnnotation = LineAnnotation(point1: CGPoint(x: 596, y: 499), point2: CGPoint(x: 500, y: 416))
        lineAnnotation.lineEnd2 =.closedArrow
        lineAnnotation.fillColor = UIColor(red: 0.87, green: 0.27, blue: 0.30, alpha: 1)
        lineAnnotation.color = UIColor(red: 0.87, green: 0.27, blue: 0.30, alpha: 1)
        annotations.append(lineAnnotation)

        return annotations
    }

    private static func annotationsForLayer2() -> [Annotation] {
        var annotations = [Annotation]()

        let needsRevisionStamp = StampAnnotation(title: "Needs Revision")
        needsRevisionStamp.boundingBox = CGRect(x: 1065, y: 421, width: 90, height: 21)
        annotations.append(needsRevisionStamp)

        let lightingsComment = FreeTextAnnotation(contents: "We can add more lights here.")
        lightingsComment.boundingBox = CGRect(x: 506, y: 246, width: 128, height: 15)
        lightingsComment.borderColor =.blue
        lightingsComment.fontSize = 9.5
        annotations.append(lightingsComment)

        let squigglyAnnotation = SquareAnnotation()
        squigglyAnnotation.borderEffect =.cloudy
        squigglyAnnotation.borderColor =.blue
        squigglyAnnotation.borderEffectIntensity = 1
        squigglyAnnotation.lineWidth = 1
        squigglyAnnotation.boundingBox = CGRect(x: 485, y: 240, width: 162, height: 54)
        annotations.append(squigglyAnnotation)

        return annotations
    }

    private static func annotationsForLayer3() -> [Annotation] {
        var annotations = [Annotation]()

        let approvedStamp = StampAnnotation(stampType:.approved)
        approvedStamp.boundingBox = CGRect(x: 748, y: 286, width: 275, height: 95)
        annotations.append(approvedStamp)

        let freeText = FreeTextAnnotation(contents: "We are good to go!")
        freeText.boundingBox = CGRect(x: 755, y: 144, width: 275, height: 98)
        freeText.borderColor =.green
        freeText.fontSize = 40
        annotations.append(freeText)

        return annotations
    }
}

```

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

---

## Related pages

- [Implement a Document Picker sidebar in Swift for iOS](/guides/ios/samples/document-picker-sidebar.md)
- [Add file annotation to PDF in Swift for iOS](/guides/ios/samples/add-file-annotation-with-embedded-file.md)
- [Add a custom cloudy rectangle annotation to a PDF in Swift for iOS](/guides/ios/samples/add-custom-cloudy-rectangle.md)
- [Create an always-dark annotation toolbar in Swift for iOS](/guides/ios/samples/always-dark-annotation-toolbar.md)
- [Add an image signature to PDF in Swift for iOS](/guides/ios/samples/add-image-signature-to-pdf-programmatically.md)
- [Add an Apple Maps widget to a PDF page in Swift for iOS](/guides/ios/samples/add-map-widget-to-pdf.md)
- [Add image gallery to PDF in Swift for iOS](/guides/ios/samples/add-image-gallery-to-pdf.md)
- [Add video annotation to PDF in Swift for iOS](/guides/ios/samples/add-video-annotation-to-pdf.md)
- [Customize blend modes in stamp annotations in Swift for iOS](/guides/ios/samples/annotation-inspector-stamp-blend-mode.md)
- [Maintain annotation aspect ratio in Swift](/guides/ios/samples/aspect-ratio-conserving-resizing.md)
- [Add analytics to PDF components in Swift for iOS](/guides/ios/samples/analytics.md)
- [Image annotations in Swift for iOS](/guides/ios/samples/annotate-images.md)
- [Enable auto-save in PDF using Swift for iOS](/guides/ios/samples/auto-saving-pdf.md)
- [Blur PDF page in Swift for iOS](/guides/ios/samples/blur-pdf-pages.md)
- [Embed Nutrient as a child view controller in Swift for iOS](/guides/ios/samples/child-view-controller-using-parent-navigation-bar.md)
- [Present a confirmation sheet for iOS annotations](/guides/ios/samples/confirm-annotation-deletion.md)
- [Write PDF annotations to XFDF in Swift for iOS](/guides/ios/samples/annotations-to-xfdf.md)
- [Add annotation buttons to PDF toolbar in Swift for iOS](/guides/ios/samples/annotation-buttons-in-navigation-bar.md)
- [Select PDF text and create a note in Swift for iOS](/guides/ios/samples/create-note-from-selection.md)
- [Creating effective link annotations on iOS](/guides/ios/samples/annotations.md)
- [Add calculator to PDF using JavaScript on iOS](/guides/ios/samples/calculator.md)
- [Create link annotations in PDF using Swift for iOS](/guides/ios/samples/create-link-annotation-in-pdf.md)
- [Create a custom appearance stream generator in Swift for iOS](/guides/ios/samples/appearance-stream-generator.md)
- [PDFViewController controller state in Swift for iOS](/guides/ios/samples/controller-state.md)
- [Create PDF bookmark with UI in Swift for iOS](/guides/ios/samples/create-pdf-bookmark-name-ui.md)
- [Create PDF programmatically in Swift for iOS](/guides/ios/samples/create-pdf-programmatically.md)
- [Add a custom free text input accessory in Swift for iOS](/guides/ios/samples/custom-free-text-input-accessory.md)
- [Add custom font sizes to free text keyboard in Swift for iOS](/guides/ios/samples/custom-buttons-free-text-keyboard-toolbar.md)
- [Customize PDF page lables in Swift for iOS](/guides/ios/samples/custom-page-label.md)
- [Customize the filename of shared PDF in Swift for iOS](/guides/ios/samples/custom-sharing-filenames.md)
- [Customize PDF annotation toolbar in Swift for iOS](/guides/ios/samples/customize-pdf-annotation-toolbar.md)
- [Customized note annotation view controller in Swift for iOS](/guides/ios/samples/customized-note-annotation-view-controller.md)
- [Custom thumbnail PDF view filter in Swift for iOS](/guides/ios/samples/custom-thumbnail-view-controller-filter.md)
- [Custom Comments Ui](/guides/ios/samples/custom-comments-ui.md)
- [Disable annotations reviews in PDF using Swift for iOS](/guides/ios/samples/disable-annotation-reviews.md)
- [Customize PDF outline in Swift for iOS](/guides/ios/samples/custom-pdf-outline-controller.md)
- [Customize pencil interactions on PDF using Swift for iOS](/guides/ios/samples/custom-pencil-interaction-action.md)
- [Custom Thumbnail Page Label](/guides/ios/samples/custom-thumbnail-page-label.md)
- [Customize PDF sharing options in Swift for iOS](/guides/ios/samples/custom-pdf-sharing-options.md)
- [How to disable digital signature removal in PDFs](/guides/ios/samples/disable-removing-digital-signature.md)
- [Disable PDF annotation editing in Swift for iOS](/guides/ios/samples/disable-annotation-editing.md)
- [Document With Original Url Set](/guides/ios/samples/document-with-original-url-set.md)
- [Disable bookmark renaming in PDF using Swift for iOS](/guides/ios/samples/disable-bookmark-renaming.md)
- [Add watermark to all PDF pages using Swift for iOS](/guides/ios/samples/draw-watermark-on-pdf-pages.md)
- [Customize the PDF search highlight color in Swift for iOS](/guides/ios/samples/custom-search-highlight-color.md)
- [Customize the search result cell in Swift for iOS](/guides/ios/samples/custom-search-result-cell.md)
- [Custom PDF stamp annotation in Swift for iOS](/guides/ios/samples/custom-pdf-stamp-annotations.md)
- [Disable scroll bouncing in PDF using Swift for iOS](/guides/ios/samples/disable-scroll-bouncing.md)
- [Display PDF in inbox directory using Swift for iOS](/guides/ios/samples/display-pdf-inbox.md)
- [Configuring PDF reader in Swift for iOS](/guides/ios/samples/e-reader.md)
- [Customize PDF view margins using Swift for iOS](/guides/ios/samples/dynamic-margins.md)
- [Add text annotation to PDF in Swift for iOS](/guides/ios/samples/add-text-annotation-to-pdf.md)
- [Embed, flatten, or remove PDF annotations in Swift for iOS](/guides/ios/samples/annotation-processing.md)
- [Using a custom annotation provider in Swift for iOS](/guides/ios/samples/annotation-provider-with-rotation.md)
- [Add copyright watermark to PDF in Swift for iOS](/guides/ios/samples/add-copyright-watermark-to-pdf.md)
- [Prepare PDF to capture digital signature in Swift for iOS](/guides/ios/samples/contained-digital-signatures.md)
- [Prepare PDF to embed PAdES digital signature in Swift for iOS](/guides/ios/samples/contained-pades-digital-signature.md)
- [Custom annotation provider in Swift for iOS](/guides/ios/samples/custom-annotation-provider.md)
- [Customize vertical annotation toolbar in Swift for iOS](/guides/ios/samples/custom-vertical-annotation-toolbar.md)
- [Customize the annotations list in Swift for iOS](/guides/ios/samples/customizing-annotation-list.md)
- [Customize PDF form appearance in Swift for iOS](/guides/ios/samples/customizing-pdf-form-appearance.md)
- [Customize the annotation selection knobs in Swift for iOS](/guides/ios/samples/custom-selection-knobs.md)
- [Custom PDF bookmark provider in Swift for iOS](/guides/ios/samples/custom-pdf-bookmark-provider.md)
- [Draw all PDF annotations as overlays in Swift for iOS](/guides/ios/samples/draw-annotations-as-overlay.md)
- [Asynchronously sign PDF in Swift for iOS](/guides/ios/samples/asynchronous-digital-signature-in-pdf.md)
- [LMS example: Take and grade an exam using Swift for iOS](/guides/ios/samples/e-learning.md)
- [Collaborating on PDFs in board meetings using Swift for iOS](/guides/ios/samples/board-meeting.md)
- [Programatically create PDF annotations in Swift for iOS](/guides/ios/samples/add-annotations-to-pdf-programmatically.md)
- [Customize annotation link border color in Swift for iOS](/guides/ios/samples/custom-link-border-color.md)
- [Customize PDF tab titles in Swift for iOS](/guides/ios/samples/custom-tabbed-bar-title.md)
- [Save reading position in PDF using Swift for iOS](/guides/ios/samples/document-view-state-restoration.md)
- [Use a custom image picker controller in Swift for iOS](/guides/ios/samples/custom-image-picker-controller.md)
- [Create password-protected PDF in Swift for iOS](/guides/ios/samples/create-password-protected-pdf.md)
- [Disable bookmark editing in PDF using Swift for iOS](/guides/ios/samples/disable-bookmark-editing.md)
- [Continiously create free text annotations in Swift for iOS](/guides/ios/samples/create-free-text-annotations-continuously.md)
- [Clear all PDF annotations with a button in Swift for iOS](/guides/ios/samples/custom-button-in-annotation-toolbar.md)
- [Embed PDFViewController as a child in iOS](/guides/ios/samples/child-view-controller.md)
- [Display building floor plans in iOS with Swift](/guides/ios/samples/construction.md)
- [Apply XFDF annotations and save it as new PDF in Swift for iOS](/guides/ios/samples/embedded-xfdf-annotation-provider.md)
- [Fixed-sized PDF stamp annotations in Swift for iOS](/guides/ios/samples/floating-pdf-stamp-annotation.md)
- [PDF highlight annotation blend mode menu in Swift for iOS](/guides/ios/samples/highlight-annotation-blend-mode-menu.md)
- [Insert page into PDF from another document in Swift for iOS](/guides/ios/samples/insert-pdf-page-from-document.md)
- [Exit PDF drawing mode automatically in Swift for iOS](/guides/ios/samples/exit-drawing-mode-automatically.md)
- [Initialize a PDF with data in Swift for iOS](/guides/ios/samples/document-data-provider-pdf-from-data.md)
- [Add a bottom inset to the user interface in Swift for iOS](/guides/ios/samples/inset-user-interface.md)
- [Add video, audio, image annotation to PDF in Swift for iOS](/guides/ios/samples/gallery.md)
- [Convert HTML to PDF using Swift for iOS](/guides/ios/samples/html-to-pdf.md)
- [Customize comment font size in PDF using Swift for iOS](/guides/ios/samples/large-font-for-comments.md)
- [Configuring multiline titles in PDF using Swift for iOS](/guides/ios/samples/multiline-pdf-title.md)
- [Open AES-encrypted PDF in Swift for iOS](/guides/ios/samples/open-aes-encrypted-pdf.md)
- [Link annotation view customization in Swift for iOS](/guides/ios/samples/link-annotation-view-customization.md)
- [Monitor UI touches using Swift for iOS](/guides/ios/samples/monitor-touches.md)
- [Encrypt and decrypt a PDF using Swift for iOS](/guides/ios/samples/encrypt-decrypt-pdf.md)
- [Add overlay views to PDF in Swift for iOS](/guides/ios/samples/overlay-views.md)
- [Encrypted Xfdf Annotation Provider](/guides/ios/samples/encrypted-xfdf-annotation-provider.md)
- [Face redaction in document using Swift for iOS](/guides/ios/samples/face-redaction-in-pdf.md)
- [Configure PDF annotation toolbar using Swift for iOS](/guides/ios/samples/manual-toolbar-setup.md)
- [OCR PDF using Swift for iOS](/guides/ios/samples/ocr-pdf.md)
- [Password Not Preset](/guides/ios/samples/password-not-preset.md)
- [Lazy load PDF annotations in Swift for iOS](/guides/ios/samples/lazy-load-pdf-annotations.md)
- [Customize PDF editor toolbar using Swift for iOS](/guides/ios/samples/pdf-editor-toolbar-customization.md)
- [Custom PDF page labels in the sharing UI in Swift for iOS](/guides/ios/samples/page-labels-in-sharing-ui.md)
- [Allow freeform image annotation resizing in Swift for iOS](/guides/ios/samples/freeform-image-resize.md)
- [Custom saving options after editing PDF in Swift for iOS](/guides/ios/samples/pdf-editor-custom-saving-confirmation.md)
- [Create email snippet when sharing PDF in Swift for iOS](/guides/ios/samples/predefined-email-body.md)
- [Create PDF teleprompter using Swift for iOS](/guides/ios/samples/pdf-teleprompter.md)
- [Persist view settings using Swift for iOS](/guides/ios/samples/persist-view-settings.md)
- [Programmatically edit PDFs using Swift for iOS](/guides/ios/samples/programmatic-pdf-editing.md)
- [PDF reflow with Reader View in Swift for iOS](/guides/ios/samples/pdf-reader-view.md)
- [Display PDFViewController in popover using Swift for iOS](/guides/ios/samples/popover-presentation.md)
- [Toggle PDF form field highlight color in Swift for iOS](/guides/ios/samples/pdf-form-highlight-color.md)
- [Printer defaults for PDF annotations in Swift for iOS](/guides/ios/samples/printer-defaults.md)
- [Rotate PDF pages with Swift](/guides/ios/samples/rotate-page-temporarily.md)
- [Download PDF from URL using Swift for iOS](/guides/ios/samples/remote-document-url.md)
- [Rotate PDF page using Swift for iOS](/guides/ios/samples/rotate-pdf-page.md)
- [Open PDF with preset password using Swift for iOS](/guides/ios/samples/preset-pdf-passwords.md)
- [Remove password from PDF using Swift for iOS](/guides/ios/samples/remove-pdf-password.md)
- [Custom page template in PDF editor using Swift for iOS](/guides/ios/samples/pdf-editor-custom-templates.md)
- [Select free text annotation in PDF using Swift for iOS](/guides/ios/samples/select-free-text-annotations.md)
- [Simplifying the font picker for text annotation using Swift for iOS](/guides/ios/samples/simple-font-picker.md)
- [Customize iOS annotation inspector color presets](/guides/ios/samples/preset-customization.md)
- [Enable saving confirmation when exiting PDF in Swift for iOS](/guides/ios/samples/save-confirmation.md)
- [Customize scrubber bar with buttons using Swift for iOS](/guides/ios/samples/scrubber-bar-with-buttons.md)
- [Redact text in PDF using Swift for iOS](/guides/ios/samples/pdf-redaction.md)
- [Search multiple PDF files using Swift for iOS](/guides/ios/samples/search-multiple-pdf-files.md)
- [Customize view controller for screen mirroring in Swift for iOS](/guides/ios/samples/screen-mirroring.md)
- [Convert stamp into a PDF button in Swift for iOS](/guides/ios/samples/stamp-button.md)
- [Select all text in a PDF using Swift for iOS](/guides/ios/samples/select-all-pdf-text.md)
- [Simplifying the annotation inspector using Swift for iOS](/guides/ios/samples/simple-annotation-inspector.md)
- [Generate a PDF report using Swift for iOS](/guides/ios/samples/generate-pdf-report.md)
- [Hide or reveal an area in a PDF using Swift for iOS](/guides/ios/samples/hide-reveal-area-in-pdf.md)
- [Multi-user PDF collaboration using Swift for iOS](/guides/ios/samples/multi-user-pdf-collaboration.md)
- [Display measurements on PDF pages or spreads in Swift for iOS](/guides/ios/samples/measurements-on-pages-spreads.md)
- [Using Instant JSON to collaborate on PDFs in Swift for iOS](/guides/ios/samples/instant-json.md)
- [Show PDF download progress in Swift for iOS](/guides/ios/samples/pdf-download-progress.md)
- [Compare PDF documents using Swift for iOS](/guides/ios/samples/pdf-document-comparison.md)
- [PDF page scale and resize using Swift for iOS](/guides/ios/samples/pdf-page-scaling.md)
- [PDF collaboration using Swift for iOS](/guides/ios/samples/pdf-collaboration.md)
- [Highlight text in PDF using Swift for iOS](/guides/ios/samples/highlight-text-in-pdf.md)
- [Cycle through PDF documents using Swift for iOS](/guides/ios/samples/page-view-controller.md)
- [PDF text redaction using regex in Swift for iOS](/guides/ios/samples/redact-pdf-text-using-regex.md)
- [PDF magazine reader using Swift for iOS](/guides/ios/samples/pdf-magazine-reader.md)
- [Search and redact text in a PDF using Swift for iOS](/guides/ios/samples/search-and-redact-pdf-text.md)
- [Programmatically add a signature to all PDF pages using Swift for iOS](/guides/ios/samples/sign-all-pdf-pages.md)
- [Store PDF annotations for multiple users in Swift for iOS](/guides/ios/samples/store-multiple-user-annotations.md)
- [Show author name on annotation selection in Swift for iOS](/guides/ios/samples/show-author-name-on-annotation-selection.md)
- [Customize PDF view settings in Swift for iOS](/guides/ios/samples/pdf-view-settings.md)
- [Auto-save PDF annotation changes in Swift for iOS](/guides/ios/samples/save-as-pdf.md)
- [Show note controller for highlights in Swift for iOS](/guides/ios/samples/show-note-controller-for-highlights.md)
- [Swiftui Sharing](/guides/ios/samples/swiftui-sharing.md)
- [Embed a SwiftUI view inside a page view on iOS](/guides/ios/samples/swiftui-on-page-view.md)
- [Programmatically go to PDF outline in Swift for iOS](/guides/ios/samples/programmatically-go-to-outline.md)
- [Show or hide PDF annotations using Swift for iOS](/guides/ios/samples/toggle-annotation-visibility.md)
- [Enable fixed PDF toolbar position in Swift for iOS](/guides/ios/samples/top-toolbar-position.md)
- [Encrypt disk cache when rendering PDF in Swift for iOS](/guides/ios/samples/encrypted-cache.md)
- [Show multiple files as a single PDF using Swift for iOS](/guides/ios/samples/show-multiple-files-in-pdf.md)
- [Use PDFViewController with SwiftUI for iOS](/guides/ios/samples/swiftui.md)
- [Create a custom PDF navigation bar with SwiftUI for iOS](/guides/ios/samples/swiftui-custom-navigation-bar.md)
- [SwiftUI split screen: Display two PDF views side by side on iOS](/guides/ios/samples/swiftui-split-screen.md)
- [Programtically search a PDF using Swift for iOS](/guides/ios/samples/search-without-controller.md)
- [Update configuration when rotating PDF in Swift for iOS](/guides/ios/samples/update-configuration-when-rotating.md)
- [Render drawings on PDF pages using Swift for iOS](/guides/ios/samples/pdf-page-drawing.md)
- [Convert MS Office (DOCX, XLSX, PPTX) to PDF in Swift for iOS](/guides/ios/samples/office-to-pdf-conversion.md)
- [Show multiple PDFs with tabbed UI using Swift for iOS](/guides/ios/samples/tabbed-bar.md)
- [Add SwiftUI sidebar next to PDF view on iOS](/guides/ios/samples/swiftui-sidebar.md)
- [PDF streaming with SwiftUI for iOS](/guides/ios/samples/streaming-pdf-swiftui.md)
- [Import and export annotations in XFDF using Swift for iOS](/guides/ios/samples/xfdf-annotation-provider.md)
- [Customize PDF annotation toolbar with SwiftUI for iOS](/guides/ios/samples/swiftui-annotationt-toolbar.md)
- [Custom annotation inspector with SwiftUI for iOS](/guides/ios/samples/swiftui-custom-annotation-inspector.md)
- [Sticky header for PDF thumbnail view in Swift for iOS](/guides/ios/samples/sticky-header.md)
- [PDF streaming using Swift for iOS](/guides/ios/samples/streaming-pdf.md)
- [Create a custom PDF page setting view in SwiftUI for iOS](/guides/ios/samples/swiftui-settings.md)
- [Add a snake game inside a PDF in Swift for iOS](/guides/ios/samples/snake.md)
- [Integrate UIStoryboard with PDFViewController in Swift for iOS](/guides/ios/samples/storyboard.md)
- [PDF form examples using Swift for iOS](/guides/ios/samples/pdf-forms.md)
- [Aviation example: Displaying flight plan PDF in Swift for iOS](/guides/ios/samples/aviation.md)
- [Getting started with iOS playground](/guides/ios/samples/playground.md)

