Closed msk-psp closed 5 years ago
Have a look at OverlayContainerViewControllerDelegate
in the code and also check the example with multiple overlays. Especially:
func overlayContainerViewController(_ containerViewController: OverlayContainerViewController,
heightForNotchAt index: Int,
availableSpace: CGFloat) -> CGFloat {
return notchHeight(at: index, availableSpace: availableSpace)
}
Is probably a good place to start. You probably need to invalidate the notch settings and make sure that you calculation is based on the currently 'going to be presented' UIViewController you use as content.
As @joustava said, the notches are independent of your navigation stack. So move the overlay right before pushing your view controller:
overlayController.invalidateNotchHeights()
overlayController.moveOverlay(toNotchAt: 0, animated: true)
overlayNavigationController.push(newViewController, animated: true)
heightForNotchAt
will be called at the moveOverlay
line. Return your new notch height.
Thank you for you guys replies ^^ I will try it
I was successfully implemented the function properly because of reference your replies, Thank you guys
I want to adjust the height of the notches when I push a viewcontroller which has a different height with first pushed viewcontroller..
is It possible?