SKOverlay frame size

Does anyone know if the frame size of SKOverlay is made available as a read-only variable? I would like to display the SKOverlay within my app, but adapt the UI of my app around it to size and fit perfectly.

At the moment from the Apple documentation, properties of the overlay appear to be limited.
The frame of an SKOverlay can be accessed by implementing the SKOverlayDelegate protocol. An instance of SKOverlay.TransitionContext is provided as an argument to the presentation delegate methods and has startFrame and endFrame properties that reflect the frame of the overlay before and after the enter/exit animations.

Responding to SKOverlay delegate methods is covered in more depth in the What’s new with in-app purchase WWDC session.

What about on orientation change? Delegate method isn't called when the orientation changes. If my current view controller has an overlay feels like I should be able to access the frame at anytime...to make sure my content doesn't overlap the overlay? Perhaps something like this?

@interface UIWindowScene (SKOverlay)

@property (nullable,nonatomic,strong,readonly) SKOverlay *presentedOverlay;

@end

@interface SKOverlay (FrameInView)

-(void)overlayFrameConvertedToView:(UIView*)view;

@end

//From my view controller...
-(void)viewDidLayoutSubviews
{
   [super viewDidLayoutSubviews];
   UIWindowScene *scene = self.view.window.windowScene;
   SKOverlay *presentedOverlay = scene.presentedOverlay;
   if (presentedOverlay == nil) 
   {
       //No overlay...layout
   }
   else
  {
      //overlay is showing...don't place anything inside its rect...
       CGRect overlayRect = [presentedOverlay overlayFrameConvertedToView:self.view];
     
  } 
}

Why doesn't SKOverlay provide a frame/API to convert its current rect into any arbitrary view in the same window scene? I'm assuming the SKOverlay is being shown in a different UIWindow....showing the SKOverlay doesn't even cause -viewSafeAreaInsetsDidChange to be called. Seems like this object can only be used in the simplest of view controllers.

My workaround is to remove and recreate the SKOverlay on orientation change. Also have to hold the SKOverlayTransitionContext's endFrame in a property to access the current location during other events (like viewDidLayoutSubviews etc.) Feels like this API could be improved.

SKOverlay frame size
 
 
Q