Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There could be various reasons for this. However, one common reason is that the bottom sheet hasn't been fully initialized or laid out yet. When a view controller is presented on top of another view controller, it takes some time for the view hierarchy to settle and layout to occur. During this time, the frame and position of the bottom sheet layer may be undefined or NaN.

To resolve this issue, you can try delaying the initialization of the bottom sheet until the parent view controller's view layout is completed or override the viewWillLayoutSubviews method and manually update the bottom sheet's layer position once the parent layout is complete. Additionally, you can also check if the bottom sheet layer is nil before accessing its properties to avoid any crashes or undefined behavior.