SPB Git

Repository Public

PencilBlockDetails.swift 934 B 22 lines swift

1// SP Notes iOS2// File: Features/Drawing/PencilBlockDetails.swift3// Description: The block detail provider of the Pencil screens, which belong to this app for good: the PencilKit editor of a4//              `drawing` block and the PDF annotation screen of a `pdf` block. Registered with the `.platform` priority.5//6// Author: Simon-Pierre Boucher7// Contact: contact@spboucher.ai8import SPNotesCore9import SwiftUI1011@MainActor12struct PencilBlockDetails: BlockDetailProviding {13    func canPresent(_ node: PMNode) -> Bool { node.type == DrawingBlock.nodeType || node.type == PDFBlock.nodeType }1415    func style(for node: PMNode) -> BlockDetailStyle { .fullScreen }1617    func view(for node: PMNode, context: BlockDetailContext) -> AnyView {18        if node.type == PDFBlock.nodeType { return AnyView(PDFAnnotationScreen(node: node, context: context)) }19        return AnyView(DrawingBlockScreen(node: node, context: context))20    }21}22
Files main
Menu

Theme