1,%SBXJOHͱ6**NBHF%BUBܕͷ૬ޓมΛ͢Δ w ࢦͱ"QQMF1FODJMͷλονΛࣝผ͢Δ ɹʢͨͩ͠BMMPXT'JOHFS%SBXJOH͕J04͔Β%FQSFDBUFEʹͳ͍ͬͯΔʣ w %FMFHBUFϝιουܦ༝ͰESBXJOHͷมߋɺ 5PPM1JDLFSͷ༻ͷTUBSUFOEΛݕ͢Δ
/// Names of the drawing assets to be used to initialize the data model the first time. static let defaultDrawingNames: [String] = ["Notes"] /// The width used for drawing canvases. static let canvasWidth: CGFloat = 768 /// The drawings that make up the current data model. var drawings: [PKDrawing] = [] var signature = PKDrawing() }
the drawing has changed. func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) { hasModifiedDrawing = true updateContentSizeForDrawing() } /// Helper method to set a suitable content size for the canvas view. func updateContentSizeForDrawing() { // Update the content size to match the drawing. let drawing = canvasView.drawing let contentHeight: CGFloat // Adjust the content size to always be bigger than the drawing height. if !drawing.bounds.isNull { contentHeight = max(canvasView.bounds.height, (drawing.bounds.maxY + DrawingViewController.canvasOverscrollHeight) * canvasView.zoomScale) } else { contentHeight = canvasView.bounds.height } canvasView.contentSize = CGSize(width: DataModel.canvasWidth * canvasView.zoomScale, height: contentHeight) } ˞88%$ͷαϯϓϧΑΓ