'iOS: How to remove UIViewController shadow changes as another UIViewController is being pushed/popped

I have two UIViewController objects with a white background color. When I push page A over page B through a UINavigationController, I notice that iOS is adding a shadow on page B during page transition. Similarly, when page A is being popped, page B reverts its shadow change slowly.

Is it possible to remove shadow animations during page push/pop actions?

I found UINavigationController remove drop shadow when transitioning to another VC which is somewhat similar, but it seems to be about a drop shadow added to the edge of page A. Also, as one of the comments suggests, losing the ability to swipe back is not an option for me.

I'm on iOS 15.4 and would like to know if there is a way to disable shadows.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source