Hi,
Shortly: On iPadOS27, when changing the color of a PKInk programmatically, it doesn't reflect in PKDrawing on screen.
In all previous versions of iPadOS I was able to change the color of a PencilKit stroke via:
canvasView.drawing.strokes[0].ink.color = .red
And it changed on screen. As of iPadOS 27 - it doesn't.
However, the underlying data is changing correctly:
print(canvasView.drawing.strokes[0].ink.color) //prints: "UIExtendedSRGBColorSpace 0 0.533333 1 1" - blue color.
canvasView.drawing.strokes[0].ink.color = .red
print(canvasView.drawing.strokes[0].ink.color) //prints: "UIExtendedSRGBColorSpace 1 0 0 1" - red color, good.
But the stroke stays blue on screen.
I've filed a Feeback at FB24771438. And am using a temp workaround to "refresh" the drawing with:
let current = canvasView.drawing
canvasView.drawing = PKDrawing() //blank one
canvasView.drawing = current
IMHO, it should be possible to change the color like that and re-render it in the View right away, since the PKInk's .color property is a { get set } property. Is this the intended behavior? A bug or a feature? Thanks!
0
0
49