I've watched this WWDC session as well as its sample project: https://developer.apple.com/documentation/pencilkit/inspecting_modifying_and_constructing_pencilkit_drawings
However, when I try to plot CGPoints on my drawing canvas, nothing shows up.
Here's my setup:
var points: [CGPoint] = []
(500...1000).forEach { x in
(500...1000).forEach { y in
points.append(CGPoint(x: x, y: y))
}
}
let strokePoints = points.map {
PKStrokePoint(location: $0, timeOffset: 0, size: CGSize(uniform: 1), opacity: 2, force: 1, azimuth: 1, altitude: 1)
}
let strokePath = PKStrokePath(controlPoints: strokePoints, creationDate: Date())
let stroke = PKStroke(ink: PKInk(.pen, color: .systemGreen), path: strokePath)
canvasView.drawing = PKDrawing(strokes: [ stroke ])