One Logo Pool Ball
PaperKit · IOS API REFERENCE

PaperMarkup

struct · iOS 26.0+ · SDK 27.1

struct PaperMarkup

The data model object for storing markup data created from a `PaperViewController`.

Members (24)

get · iOS 26.0+

featureSet

TypeScript
get featureSet(): FeatureSet
Swift declaration
var featureSet: FeatureSet { get }

The set of features used by this data model.

get · iOS 27.0+

subelements

TypeScript
get subelements(): MarkupOrderedSet
Swift declaration
var subelements: MarkupOrderedSet { get set }

The subelements of the paper markup. Includes shapes, images, strokes, etc.

set · iOS 27.0+

subelements

TypeScript
set subelements(value: MarkupOrderedSet)
Swift declaration
var subelements: MarkupOrderedSet { get set }

The subelements of the paper markup. Includes shapes, images, strokes, etc.

method · iOS 26.0+

insertNewLine

TypeScript
insertNewLine(configuration: ShapeConfiguration, start: { x: number; y: number }, end: { x: number; y: number }, lineStartMarker?: boolean, lineEndMarker?: boolean): void
Swift declaration
mutating func insertNewLine(configuration: ShapeConfiguration, from start: CGPoint, to end: CGPoint, startMarker lineStartMarker: Bool = false, endMarker lineEndMarker: Bool = false)

Add a line element on top of the paper. - Parameters: - configuration: The configuration of the line to insert. - start: The start position of the line. - end: The end position of the line. - lineStartMarker: True if the start of the line has a marker / arrow. - lineEndMarker: True if the end of the line has a marker / arrow.

method · iOS 26.0+

insertNewImage

TypeScript
insertNewImage(image: _CoreGraphics_CGImage, frame: { x: number; y: number; width: number; height: number }, rotation?: number): void
Swift declaration
mutating func insertNewImage(_ image: CGImage, frame: CGRect, rotation: CGFloat = 0)

Add a new image on top of the paper. - Parameters: - image: The image to add. - frame: The frame to add the image at. - rotation: The rotation in radians to add the element with.

method · iOS 26.0+

insertNewShape

TypeScript
insertNewShape(configuration: ShapeConfiguration, frame: { x: number; y: number; width: number; height: number }, rotation?: number): void
Swift declaration
mutating func insertNewShape(configuration: ShapeConfiguration, frame: CGRect, rotation: CGFloat = 0)

Add a new element on top of the paper. - Parameters: - configuration: The configuration of the shape to insert. - frame: The frame to add the element at. - rotation: The rotation in radians to add the element with.

get · iOS 27.0+

backgroundColor

TypeScript
get backgroundColor(): (_CoreGraphics_CGColor) | null
Swift declaration
var backgroundColor: CGColor? { get set }

The background color of the paper. Default is `nil`, which uses a default color based on the current user interface style.

set · iOS 27.0+

backgroundColor

TypeScript
set backgroundColor(value: (_CoreGraphics_CGColor) | null)
Swift declaration
var backgroundColor: CGColor? { get set }

The background color of the paper. Default is `nil`, which uses a default color based on the current user interface style.

get · iOS 26.0+

indexableContent

TypeScript
get indexableContent(): Promise<(string) | null>
Swift declaration
var indexableContent: String? { get async }
method · iOS 26.0+

insertNewTextbox

TypeScript
insertNewTextboxAttributedTextFrameRotation(attributedText: _Foundation_AttributedString, frame: { x: number; y: number; width: number; height: number }, rotation?: number): void
Swift declaration
mutating func insertNewTextbox(attributedText: AttributedString, frame: CGRect, rotation: CGFloat = 0)

Add a new text box on top of the paper. - Parameters: - attributedText: The text inside the element. - frame: The frame to add the element at. - rotation: The rotation in radians to add the element with.

method · iOS 26.0+

insertNewTextbox

TypeScript
insertNewTextboxAttributedTextFrameRotation68161(attributedText: _Foundation_NSAttributedString, frame: { x: number; y: number; width: number; height: number }, rotation?: number): void
Swift declaration
mutating func insertNewTextbox(attributedText: NSAttributedString, frame: CGRect, rotation: CGFloat = 0)

Add a new text box on top of the paper. - Parameters: - attributedText: The text inside the element. - frame: The frame to add the element at. - rotation: The rotation in radians to add the element with.

method · iOS 26.0+

transformContent

TypeScript
transformContent(transform: _CoreFoundation_CGAffineTransform): void
Swift declaration
mutating func transformContent(_ transform: CGAffineTransform)

Transforms the contents of this paper with the specified transform. - Parameters: - transform: The transform applied to the contents of this paper. Skew is ignored.

method · iOS 26.0+

dataRepresentation

TypeScript
dataRepresentation(): Promise<ArrayBuffer>
Swift declaration
func dataRepresentation() async throws -> Data

Generate a serialized data representation of the data model. - Returns: A new serialized data containing a representation of the paper.

init · iOS 26.0+

init

TypeScript
static initDataRepresentation(dataRepresentation: ArrayBuffer): PaperMarkup
Swift declaration
init(dataRepresentation: Data) throws

Initializes and returns a new paper model from the specified data. - Parameter dataRepresentation: The data containing the serialized paper model.

get · iOS 26.0+

contentsRenderFrame

TypeScript
get contentsRenderFrame(): { x: number; y: number; width: number; height: number }
Swift declaration
var contentsRenderFrame: CGRect { get }

The frame that tightly fits the rendered contents on the paper. This frame includes padding around `contentsFrame` to ensure it includes all the rendered aspects of the content. For example, this frame will include the strokes, and shadows of any contents.

method · iOS 26.0+

removeContentUnsupported

TypeScript
removeContentUnsupported(featureSet: FeatureSet): void
Swift declaration
mutating func removeContentUnsupported(by featureSet: FeatureSet)

Remove all contents that is not supported by the provided feature set. - Parameter featureSet: The feature set to limit this data model to. After calling this method `featureSet.isSubset(of: features)` will be `true`.

get · iOS 27.0+

id

TypeScript
get id(): MarkupID<PaperMarkup>
Swift declaration
var id: MarkupID<PaperMarkup> { get set }

The unique identifier of the markup.

set · iOS 27.0+

id

TypeScript
set id(value: MarkupID<PaperMarkup>)
Swift declaration
var id: MarkupID<PaperMarkup> { get set }

The unique identifier of the markup.

method · iOS 26.0+

draw

TypeScript
draw(context: _CoreGraphics_CGContext, frame: { x: number; y: number; width: number; height: number }, options?: RenderingOptions): Promise<void>
Swift declaration
nonisolated(nonsending) func draw(in context: CGContext, frame: CGRect, options: RenderingOptions = RenderingOptions()) async

Draws the entire paper contents in the specified rectangle. - Parameters: - context: The graphics context to render into. - frame: The rectangle (in the coordinate system of the graphics context) in which to draw the paper. - options: The rendering options. To draw a cropped portion of a paper data model, modify the `bounds` of the paper being drawn.

method · iOS 26.0+

append

TypeScript
appendContentsOf(drawing: _PencilKit_PKDrawing): void
Swift declaration
mutating func append(contentsOf drawing: PKDrawing)

Adds the contents of a PencilKit drawing on top of this paper. - Parameters: - drawing: The drawing whose contents is added on top of this paper.

method · iOS 26.0+

append

TypeScript
appendContentsOf77581(other: PaperMarkup): void
Swift declaration
mutating func append(contentsOf other: PaperMarkup)

Adds the contents of a data model on top of this paper. - Parameters: - other: The data model whose contents is added on top of this paper.

init · iOS 26.0+

init

TypeScript
static initBounds(bounds: { x: number; y: number; width: number; height: number }): PaperMarkup
Swift declaration
init(bounds: CGRect)

Initializes and returns a new paper model with the specified bounds. - Parameters: - bounds: The bounds of the markup container.

get · iOS 26.0+

bounds

TypeScript
get bounds(): { x: number; y: number; width: number; height: number }
Swift declaration
var bounds: CGRect { get set }

The bounds of the paper. The contents of the paper are positioned relative to its bounds.

set · iOS 26.0+

bounds

TypeScript
set bounds(value: { x: number; y: number; width: number; height: number })
Swift declaration
var bounds: CGRect { get set }

The bounds of the paper. The contents of the paper are positioned relative to its bounds.

Skipped declarations

No declarations were skipped in this snapshot.

All PaperKit types →