toolPickerIsRulerActiveDidChange
TypeScripttoolPickerIsRulerActiveDidChange(toolPicker: _PencilKit_PKToolPicker): Promise<void>Swift declaration@MainActor @preconcurrency func toolPickerIsRulerActiveDidChange(_ toolPicker: PKToolPicker)class · iOS 26.0+ · SDK 27.1
@MainActor @objc @preconcurrency class PaperMarkupViewControllerA view controller for interactively creating and showing markup. 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) } } ```
toolPickerIsRulerActiveDidChange(toolPicker: _PencilKit_PKToolPicker): Promise<void>Swift declaration@MainActor @preconcurrency func toolPickerIsRulerActiveDidChange(_ toolPicker: PKToolPicker)toolPickerSelectedToolItemDidChange(toolPicker: _PencilKit_PKToolPicker): Promise<void>Swift declaration@MainActor @preconcurrency func toolPickerSelectedToolItemDidChange(_ toolPicker: PKToolPicker)viewDidLoad(): Promise<void>Swift declaration@MainActor @preconcurrency override dynamic func viewDidLoad()get canBecomeFirstResponder(): Promise<boolean>Swift declaration@MainActor @preconcurrency override dynamic var canBecomeFirstResponder: Bool { get }get undoManager(): Promise<(_Foundation_UndoManager) | null>Swift declaration@MainActor @preconcurrency override dynamic var undoManager: UndoManager? { get }markupEditViewControllerInsertNewShape(markupEditViewController: MarkupEditViewController, type: ShapeConfiguration_Shape): Promise<void>Swift declaration@MainActor @preconcurrency func markupEditViewController(_ markupEditViewController: MarkupEditViewController, insertNewShape type: ShapeConfiguration.Shape)Add a new shape on top of the paper. - Parameters: - markupEditViewController: The source of the action. - type: The type of shape.
markupEditViewControllerInsertNewContents(markupEditViewController: MarkupEditViewController, toInsert: PaperMarkup): Promise<void>Swift declaration@MainActor @preconcurrency func markupEditViewController(_ markupEditViewController: MarkupEditViewController, insertNewContents toInsert: PaperMarkup)Add new content on top of the paper. - Parameters: - markupEditViewController: The source of the action. - toInsert: The markup whose contents is added on top of this paper. This is used for inserting any custom content, and non-shape elements like signatures or loupes.
markupEditViewControllerInsertNewLineWithStartMarkerEndMarker(markupEditViewController: MarkupEditViewController, lineStartMarker: boolean, lineEndMarker: boolean): Promise<void>Swift declaration@MainActor @preconcurrency func markupEditViewController(_ markupEditViewController: MarkupEditViewController, insertNewLineWithStartMarker lineStartMarker: Bool, endMarker lineEndMarker: Bool)Add a new line on top of the paper. - Parameters: - markupEditViewController: The source of the action. - lineStartMarker: True if the start of the line has a marker / arrow. - lineEndMarker: True if the end of the line has a marker / arrow.
markupEditViewControllerInsertNewTextbox(markupEditViewController: MarkupEditViewController): Promise<void>Swift declaration@MainActor @preconcurrency func markupEditViewControllerInsertNewTextbox(_ markupEditViewController: MarkupEditViewController)Add a new textbox on top of the paper. - Parameters: - markupEditViewController: The source of the action.
get contentView(): Promise<(_UIKit_UIView) | null>Swift declaration@MainActor @preconcurrency var contentView: UIView? { get set }The content that markup appears on top of. The system sizes the content view to the frame of the markup and adds it below all the markup and drawing. When `nil`, markup appears on top of a blank white canvas. Default is `nil`.
setContentView(value?: (_UIKit_UIView) | null): Promise<void>Swift declaration@MainActor @preconcurrency var contentView: UIView? { get set }The content that markup appears on top of. The system sizes the content view to the frame of the markup and adds it below all the markup and drawing. When `nil`, markup appears on top of a blank white canvas. Default is `nil`.
get selectedMarkup(): Promise<PaperMarkup>Swift declaration@MainActor @preconcurrency var selectedMarkup: PaperMarkup { get set }The selected contents in the UI.
setSelectedMarkup(value: PaperMarkup): Promise<void>Swift declaration@MainActor @preconcurrency var selectedMarkup: PaperMarkup { get set }The selected contents in the UI.
get adornments(): Promise<Array<MarkupAdornment>>Swift declaration@MainActor @preconcurrency var adornments: [MarkupAdornment] { get set }An array of visual adornments that appear on the markup canvas. Adornments are supplementary visual elements you place on the canvas above the primary markup content. You position adornments using anchor points and configure them to respond to interaction, zoom scaling, and movement. - Note: Adornments are expected to have unique IDs. If two or more adornments have the same ID, the system displays only one.
setAdornments(value: Array<MarkupAdornment>): Promise<void>Swift declaration@MainActor @preconcurrency var adornments: [MarkupAdornment] { get set }An array of visual adornments that appear on the markup canvas. Adornments are supplementary visual elements you place on the canvas above the primary markup content. You position adornments using anchor points and configure them to respond to interaction, zoom scaling, and movement. - Note: Adornments are expected to have unique IDs. If two or more adornments have the same ID, the system displays only one.
get isEditable(): Promise<boolean>Swift declaration@MainActor @preconcurrency var isEditable: Bool { get set }A Boolean value that indicates whether a person can edit the canvas contents. This property controls whether a person can edit content. The default value is `true`. Coordinate this property with your `MarkupEditViewController` or `MarkupToolbarViewController` to prevent people from adding new canvas elements.
setIsEditable(value: boolean): Promise<void>Swift declaration@MainActor @preconcurrency var isEditable: Bool { get set }A Boolean value that indicates whether a person can edit the canvas contents. This property controls whether a person can edit content. The default value is `true`. Coordinate this property with your `MarkupEditViewController` or `MarkupToolbarViewController` to prevent people from adding new canvas elements.
get drawingTool(): Promise<SDKHandle>Swift declaration@MainActor @preconcurrency var drawingTool: any PKTool { get set }The tool for drawing on the canvas. When a touch is a drawing interaction, the canvas uses this tool to draw. Default is `PKInkingTool(.pen)`.
setDrawingTool(value: Implements<_PencilKit_PKTool> | SDKHandle): Promise<void>Swift declaration@MainActor @preconcurrency var drawingTool: any PKTool { get set }The tool for drawing on the canvas. When a touch is a drawing interaction, the canvas uses this tool to draw. Default is `PKInkingTool(.pen)`.
get isRulerActive(): Promise<boolean>Swift declaration@MainActor @preconcurrency var isRulerActive: Bool { get set }A Boolean value that indicates whether a ruler view is visible on the canvas.
setIsRulerActive(value: boolean): Promise<void>Swift declaration@MainActor @preconcurrency var isRulerActive: Bool { get set }A Boolean value that indicates whether a ruler view is visible on the canvas.
adornmentFrame(id: string): Promise<({ x: number; y: number; width: number; height: number }) | null>Swift declaration@MainActor @preconcurrency func adornmentFrame(for id: UUID) -> CGRect?Returns the current frame of the specified adornment. This method calculates the visual frame of an adornment based on its anchor position, image size, attachment point, zoom scale and content offset. - Parameter id: The ID of the `MarkupAdornment` whose frame you want to retrieve. - Returns: The frame of the adornment in the coordinate system of this view controller's view, or `nil` if the canvas does not display the adornment or cannot determine its frame.
get directTouchMode(): Promise<PaperMarkupViewController_TouchMode>Swift declaration@MainActor @preconcurrency var directTouchMode: PaperMarkupViewController.TouchMode { get set }The interaction mode for direct touches on the canvas. To control automatic behavior for direct touches based on system state, see `directTouchAutomaticallyDraws`. Default is `.selection`.
setDirectTouchMode(value: PaperMarkupViewController_TouchMode): Promise<void>Swift declaration@MainActor @preconcurrency var directTouchMode: PaperMarkupViewController.TouchMode { get set }The interaction mode for direct touches on the canvas. To control automatic behavior for direct touches based on system state, see `directTouchAutomaticallyDraws`. Default is `.selection`.
get contentVisibleFrame(): Promise<{ x: number; y: number; width: number; height: number }>Swift declaration@MainActor @preconcurrency var contentVisibleFrame: CGRect { get set }The visible area of content in the scroll view. Modifying this property immediately moves the canvas, to animate changing the visible rect use ``setContentVisibleFrame(_:animated:)``.
setContentVisibleFrame(value: { x: number; y: number; width: number; height: number }): Promise<void>Swift declaration@MainActor @preconcurrency var contentVisibleFrame: CGRect { get set }The visible area of content in the scroll view. Modifying this property immediately moves the canvas, to animate changing the visible rect use ``setContentVisibleFrame(_:animated:)``.
get scrollConfiguration(): Promise<PaperMarkupViewController_ScrollConfiguration>Swift declaration@MainActor @preconcurrency var scrollConfiguration: PaperMarkupViewController.ScrollConfiguration { get }The configuration object that provides access to scroll view functionality.
get supportedFeatureSet(): Promise<FeatureSet>Swift declaration@MainActor @preconcurrency var supportedFeatureSet: FeatureSet { get }The supported PaperKit features on this canvas.
setContentVisibleFrame66674(rect: { x: number; y: number; width: number; height: number }, animated: boolean): Promise<void>Swift declaration@MainActor @preconcurrency func setContentVisibleFrame(_ rect: CGRect, animated: Bool)Zooms to a specific area of the content so that it’s visible in the scroll view. - Parameters: - rect: A rectangle defining an area of the content view. The rectangle should be in the coordinate space of the data model. - animated: `true` if the scrolling should be animated, `false` if it should be immediate. This method scrolls the content so that the area defined by rect is just visible. If the area is already visible, the method does nothing.
get indirectPointerTouchMode(): Promise<PaperMarkupViewController_TouchMode>Swift declaration@MainActor @preconcurrency var indirectPointerTouchMode: PaperMarkupViewController.TouchMode { get set }The interaction mode for indirect pointer touches on the canvas. Default is `.selection`.
setIndirectPointerTouchMode(value: PaperMarkupViewController_TouchMode): Promise<void>Swift declaration@MainActor @preconcurrency var indirectPointerTouchMode: PaperMarkupViewController.TouchMode { get set }The interaction mode for indirect pointer touches on the canvas. Default is `.selection`.
suggestedFrameForInserting(frame: { x: number; y: number; width: number; height: number }): Promise<{ x: number; y: number; width: number; height: number }>Swift declaration@MainActor @preconcurrency func suggestedFrameForInserting(contentInFrame frame: CGRect) -> CGRectReturns the suggested frame for inserting shapes and other content. - Parameters: - frame: The frame of the content you want to insert. - Returns: The suggested frame for the content. Use this value to transform a `PaperMarkup` before inserting it. ```swift var shapeFrame = CGRect(x: 100, y: 100, width: 300, height: 300) // Get the default frame for inserting, and insert the shape there. let suggestedFrame = paperViewController.suggestedFrameForInserting(contentInFrame: shapeFrame) paperViewController.markup.insertNewShape(configuration: shapeConfiguration, frame: suggestedFrame) ```
get showsVerticalScrollIndicator(): Promise<boolean>Swift declaration@MainActor @preconcurrency var showsVerticalScrollIndicator: Bool { get set }A Boolean value that controls whether the vertical scroll indicator is visible. Default is `true`.
setShowsVerticalScrollIndicator(value: boolean): Promise<void>Swift declaration@MainActor @preconcurrency var showsVerticalScrollIndicator: Bool { get set }A Boolean value that controls whether the vertical scroll indicator is visible. Default is `true`.
get directTouchAutomaticallyDraws(): Promise<boolean>Swift declaration@MainActor @preconcurrency var directTouchAutomaticallyDraws: Bool { get set }A Boolean value that indicates whether direct touches automatically draw based on system state. Direct touches on the canvas behave as if `directTouchMode = .drawing` when `directTouchAutomaticallyDraws` is true, a `PKToolPicker` is visible, and the "Draw with Finger" system setting is on. Default is `true`.
setDirectTouchAutomaticallyDraws(value: boolean): Promise<void>Swift declaration@MainActor @preconcurrency var directTouchAutomaticallyDraws: Bool { get set }A Boolean value that indicates whether direct touches automatically draw based on system state. Direct touches on the canvas behave as if `directTouchMode = .drawing` when `directTouchAutomaticallyDraws` is true, a `PKToolPicker` is visible, and the "Draw with Finger" system setting is on. Default is `true`.
get showsHorizontalScrollIndicator(): Promise<boolean>Swift declaration@MainActor @preconcurrency var showsHorizontalScrollIndicator: Bool { get set }A Boolean value that controls whether the horizontal scroll indicator is visible. Default is `true`.
setShowsHorizontalScrollIndicator(value: boolean): Promise<void>Swift declaration@MainActor @preconcurrency var showsHorizontalScrollIndicator: Bool { get set }A Boolean value that controls whether the horizontal scroll indicator is visible. Default is `true`.
static init(markup: (PaperMarkup) | null, supportedFeatureSet: FeatureSet): Promise<PaperMarkupViewController>Swift declaration@MainActor @preconcurrency init(markup: PaperMarkup? = nil, supportedFeatureSet: FeatureSet)Creates a new markup view controller with the provided data model. - Parameters: - markup: The data model to show on this canvas. The default value is `nil`. - supportedFeatureSet: The features this view controller supports. The canvas limits the edits that a person can make so they’re compatible with the feature set specified. If you set a `supportedFeatureSet`, also use a similar feature set to configure any `MarkupToolbarViewController` or `MarkupEditViewController` you use.
get markup(): Promise<(PaperMarkup) | null>Swift declaration@MainActor @preconcurrency var markup: PaperMarkup? { get set }The paper data that this view controller displays. Observe `markup` to watch for markup changes.
setMarkup(value?: (PaperMarkup) | null): Promise<void>Swift declaration@MainActor @preconcurrency var markup: PaperMarkup? { get set }The paper data that this view controller displays. Observe `markup` to watch for markup changes.
get delegate(): Promise<(SDKHandle) | null>Swift declaration@MainActor @preconcurrency weak var delegate: (any PaperMarkupViewController.Delegate)? { get set }The delegate for responding to a person's actions.
setDelegate(value?: (SDKHandle) | null): Promise<void>Swift declaration@MainActor @preconcurrency weak var delegate: (any PaperMarkupViewController.Delegate)? { get set }The delegate for responding to a person's actions.
get selection(): Promise<Array<MarkupOrderedSet_ElementID>>Swift declaration@MainActor @preconcurrency var selection: Set<MarkupOrderedSet.ElementID> { get set }The current selected elements on the canvas.
setSelection(value: Array<MarkupOrderedSet_ElementID>): Promise<void>Swift declaration@MainActor @preconcurrency var selection: Set<MarkupOrderedSet.ElementID> { get set }The current selected elements on the canvas.
get zoomRange(): Promise<"animatableData" | SDKHandle>Swift declaration@MainActor @preconcurrency var zoomRange: ClosedRange<CGFloat> { get set }A floating-point range that specifies the minimum and maximum scale factor that can apply to the canvas' content. The default value is `1.0...1.0`.
setZoomRange(value: "animatableData" | SDKHandle): Promise<void>Swift declaration@MainActor @preconcurrency var zoomRange: ClosedRange<CGFloat> { get set }A floating-point range that specifies the minimum and maximum scale factor that can apply to the canvas' content. The default value is `1.0...1.0`.
No declarations were skipped in this snapshot.