Is there a way to know if UISheetPresentationController is currently being resized by the user?

I’m using UISheetPresentationController with a UIViewController.

While the sheet is being resized I’d like to position certain subviews a certain way during the resizing event. For example I may hide some subviews on a smaller detent and unhide them on a larger detent. But while the sheet is being resized in between the small and large detent I’d like to have some subviews placed at certain locations of the view hierarchy.

As far as I can tell the only way to do this is with unreliable hard coded values:

-(void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    CGFloat currentHeight = self.view.bounds.size.height;

     if (currentHeight <= mediumDetent) 
     {
         [self doLayoutForMediumDetent];
     }
     else if (currentHeight >= fullSizeDetent)
    {  
        [self doLayoutForFullSizedDetent];
    }
    else 
   {
       [self doLayoutInBetweenFullAndMediumSheetWithCurrentSize:currentHeight];
   }
}

I don't really know for sure the height of the detents. I'm using estimates so this layout code is fragile. For the medium detent the documentation states that it is "A system detent for a sheet that is approximately half the height of the screen, and is inactive in compact height." but on certain devices the medium detent height is not exactly 1/2 the screen height.

Ideally it would be nice to have API like this:

-(void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    CGFloat mediumHeight = [self.sheetPresentationController resolvedHeightForDetentWithIdentiier:someID withTraitCollection:self.traitCollection];

    CGFloat fullHeight = [self.sheetPresentationController resolvedHeightForDetentWithIdentiier:FullSizeID withTraitCollection:self.traitCollection];

     if (self.sheetPresentationController.isInLiveResize)
     {
          //do whatever during live resize
     }
     else
    { 
          //do whatever at the current size
    }
}

Is there currently a better way to achieve what I'm after?

There isn't currently a way to resolve system detents to concrete values outside of a custom detent resolver block. Please file a feedback report requesting this functionality!

Thanks for the reply. I filed FB12185065

Is there a way to know if UISheetPresentationController is currently being resized by the user?
 
 
Q