Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以PKCanvasView在 MacOS 上显示之前在 iOS 设备上创建的绘图(数据传输通过核心数据和 Cloudkit 进行)?
PKCanvasView
您可以从绘图数据初始化一个新PKDrawing对象并从中生成一个NSImage:
PKDrawing
NSImage
import PencilKit
do { let pkDrawing = try PKDrawing(data: drawingData) let nsImage = pkDrawing.image(from: pkDrawing.bounds, scale: view.window?.backingScaleFactor ?? 1) } catch { print(error) }