Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

When does toolPickerFramesObscuredDidChange get called?

In my PKCanvasView, I want to center the drawing within the visible area, which I have been able to do except for one thing: I want to take into account the portion covered by the tool picker (on iPhone). I figured I could do this using the toolPickerFramesObscuredDidChange() callback on the delegate, but it never seems to get called, while toolPickerVisibilityDidChange() gets called as expected.

I tried out the PencilKitDraw sample app from Apple, and saw pretty much the same result. The only time I see a toolPickerFramesObscuredDidChange call is when the device rotates. This doesn't help because I need the initial picker frame before rotating the device, plus my app is portrait only anyway.

So how do I get the tool picker frame if my delegate method isn't getting called?

Answered by DTS Engineer in 840601022

You can call the PKToolPicker's frameObscured(in:) method to discover the bounds being obscured by the PKToolPicker. If you would like to receive additional notifications about changes in these coordinates, please consider filing an enhancement request.

You can file an enhancement request using the Feedback Assistant. Once you file the request, please post the Feedback number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

You can call the PKToolPicker's frameObscured(in:) method to discover the bounds being obscured by the PKToolPicker. If you would like to receive additional notifications about changes in these coordinates, please consider filing an enhancement request.

You can file an enhancement request using the Feedback Assistant. Once you file the request, please post the Feedback number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

When does toolPickerFramesObscuredDidChange get called?
 
 
Q