suggestedFrameForInserting(contentInFrame:)
Returns the suggested frame for inserting shapes and other content.
Declaration
@MainActor @preconcurrency func suggestedFrameForInserting(contentInFrame frame: CGRect) -> CGRectParameters
- frame:
The frame of the content you want to insert.
Return Value
The suggested frame for the content. Use this value to transform a PaperMarkup before inserting it.
Discussion
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)