<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PaperKit",
  "identifier" : "/documentation/PaperKit/PaperMarkupViewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PaperKit"
    ],
    "preciseIdentifier" : "c:@M@PaperKit@objc(cs)PaperMarkupViewController"
  },
  "title" : "PaperMarkupViewController"
}
-->

# PaperMarkupViewController

A view controller for interactively creating and showing markup.

```
@MainActor @objc @preconcurrency class PaperMarkupViewController
```

## Overview

Properties are observable, so to save markup changes to disk, iterate over the changes to `markup`.

```
let markups = Observations.untilFinished { [weak paperViewController] in
    if let markup = paperViewController?.markup {
        return .next(markup)
    }
    return .finish
}
Task { [weak self] in
    for await newMarkup in markups {
        self?.save(model)
    }
}
```

## Topics

### Creating a view controller

[`init(markup: PaperMarkup?, supportedFeatureSet: FeatureSet)`](/documentation/PaperKit/PaperMarkupViewController/init(markup:supportedFeatureSet:))

Creates a new markup view controller with the provided data model.

### Displaying markup

[`var markup: PaperMarkup?`](/documentation/PaperKit/PaperMarkupViewController/markup)

The paper data that this view controller displays.

[`var contentView: UIView?`](/documentation/PaperKit/PaperMarkupViewController/contentView-4aeda)

The content that markup appears on top of.

[`var contentView: NSView?`](/documentation/PaperKit/PaperMarkupViewController/contentView-4hbkf)

The content that markup appears on top of.

[`var supportedFeatureSet: FeatureSet`](/documentation/PaperKit/PaperMarkupViewController/supportedFeatureSet)

The supported PaperKit features on this canvas.

### Editing markup

[`var isEditable: Bool`](/documentation/PaperKit/PaperMarkupViewController/isEditable)

A Boolean value that indicates whether a person can edit the canvas contents.

[`var drawingTool: any PKTool`](/documentation/PaperKit/PaperMarkupViewController/drawingTool)

The tool for drawing on the canvas.

[`var isRulerActive: Bool`](/documentation/PaperKit/PaperMarkupViewController/isRulerActive)

A Boolean value that indicates whether a ruler view is visible on the canvas.

### Controlling touch input

[`var directTouchMode: PaperMarkupViewController.TouchMode`](/documentation/PaperKit/PaperMarkupViewController/directTouchMode)

The interaction mode for direct touches on the canvas.

[`var directTouchAutomaticallyDraws: Bool`](/documentation/PaperKit/PaperMarkupViewController/directTouchAutomaticallyDraws)

A Boolean value that indicates whether direct touches automatically draw based on system state.

[`var indirectPointerTouchMode: PaperMarkupViewController.TouchMode`](/documentation/PaperKit/PaperMarkupViewController/indirectPointerTouchMode)

The interaction mode for indirect pointer touches on the canvas.

[`enum TouchMode`](/documentation/PaperKit/PaperMarkupViewController/TouchMode)

The canvas behavior for touches.

### Selecting elements

[`var selection: Set<MarkupOrderedSet.ElementID>`](/documentation/PaperKit/PaperMarkupViewController/selection)

The current selected elements on the canvas.

[`var selectedMarkup: PaperMarkup`](/documentation/PaperKit/PaperMarkupViewController/selectedMarkup)

The selected contents in the UI.

[`func suggestedFrameForInserting(contentInFrame: CGRect) -> CGRect`](/documentation/PaperKit/PaperMarkupViewController/suggestedFrameForInserting(contentInFrame:))

Returns the suggested frame for inserting shapes and other content.

### Managing adornments

[`var adornments: [MarkupAdornment]`](/documentation/PaperKit/PaperMarkupViewController/adornments)

An array of visual adornments that appear on the markup canvas.

[`func adornmentFrame(for: UUID) -> CGRect?`](/documentation/PaperKit/PaperMarkupViewController/adornmentFrame(for:))

Returns the current frame of the specified adornment.

### Scrolling and zooming

[`var scrollConfiguration: PaperMarkupViewController.ScrollConfiguration`](/documentation/PaperKit/PaperMarkupViewController/scrollConfiguration-swift.property)

The configuration object that provides access to scroll view functionality.

[`class ScrollConfiguration`](/documentation/PaperKit/PaperMarkupViewController/ScrollConfiguration-swift.class)

A cross-platform type that provides access to scroll view functionality.

[`var contentVisibleFrame: CGRect`](/documentation/PaperKit/PaperMarkupViewController/contentVisibleFrame)

The visible area of content in the scroll view.

[`func setContentVisibleFrame(CGRect, animated: Bool)`](/documentation/PaperKit/PaperMarkupViewController/setContentVisibleFrame(_:animated:))

Zooms to a specific area of the content so that it’s visible in the scroll view.

[`var zoomRange: ClosedRange<CGFloat>`](/documentation/PaperKit/PaperMarkupViewController/zoomRange)

A floating-point range that specifies the minimum and maximum scale factor that can apply to the canvas’ content.

### Responding to changes

[`var delegate: (any PaperMarkupViewController.Delegate)?`](/documentation/PaperKit/PaperMarkupViewController/delegate-swift.property)

The delegate for responding to a person’s actions.

[`protocol Delegate`](/documentation/PaperKit/PaperMarkupViewController/Delegate-swift.protocol)

The interface for responding to interactions in a markup view controller.

[`var undoManager: UndoManager?`](/documentation/PaperKit/PaperMarkupViewController/undoManager)

### Managing first responder status

[`var acceptsFirstResponder: Bool`](/documentation/PaperKit/PaperMarkupViewController/acceptsFirstResponder)

[`var canBecomeFirstResponder: Bool`](/documentation/PaperKit/PaperMarkupViewController/canBecomeFirstResponder)

### Managing view lifecycle

[`func loadView()`](/documentation/PaperKit/PaperMarkupViewController/loadView())

[`func viewDidLoad()`](/documentation/PaperKit/PaperMarkupViewController/viewDidLoad())

[`func viewDidAppear()`](/documentation/PaperKit/PaperMarkupViewController/viewDidAppear())

[`func viewDidLayout()`](/documentation/PaperKit/PaperMarkupViewController/viewDidLayout())

### Deprecated

[`var showsVerticalScrollIndicator: Bool`](/documentation/PaperKit/PaperMarkupViewController/showsVerticalScrollIndicator)

A Boolean value that controls whether the vertical scroll indicator is visible.

[`var showsHorizontalScrollIndicator: Bool`](/documentation/PaperKit/PaperMarkupViewController/showsHorizontalScrollIndicator)

A Boolean value that controls whether the horizontal scroll indicator is visible.

## Relationships

### Conforms To

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`Delegate-swift.protocol`](/documentation/PaperKit/MarkupToolbarViewController/Delegate-swift.protocol)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`Copyable`](/documentation/Swift/Copyable)

[`NSExtensionRequestHandling`](/documentation/Foundation/NSExtensionRequestHandling)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`PKToolPickerObserver`](/documentation/PencilKit/PKToolPickerObserver)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSEditor`](/documentation/AppKit/NSEditor)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Observable`](/documentation/Observation/Observable)

[`Delegate-swift.protocol`](/documentation/PaperKit/MarkupEditViewController/Delegate-swift.protocol)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`NSSeguePerforming`](/documentation/AppKit/NSSeguePerforming)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`Equatable`](/documentation/Swift/Equatable)

[`UIStateRestoring`](/documentation/UIKit/UIStateRestoring)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`Escapable`](/documentation/Swift/Escapable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`UIViewController`](/documentation/UIKit/UIViewController)

[`NSViewController`](/documentation/AppKit/NSViewController)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)