2

I would like to add text to a PKDrawing

Apple actually demonstrates this use case in their WWDC2020 video: https://developer.apple.com/videos/play/wwdc2020/10148

However, looking at the sample code, they simply recorded previously drawn text

Anyone familiar with fonts and vector formats: what would be a good approach to converting a single system font to PKStroke for adding to a PKDrawing?

NewEndian
  • 559
  • 2
  • 16

1 Answers1

0

your best bet is to add a custom UIView into the background of PKCanvasView and handle the drawing there, where you have 100% freedome

Turning a UIFont into a representation of PKDrawing would be almost impossible to get right, as PKDrawing/PKStroke represent Pen input (the only way i could thing of would be to fake a solid drawn rectangle and use the mask bezier to cut out the letter(s))

Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179