If you'd like to test the effect it cases, just simply delete any 4 of 5 actions in SpotifyExampleViewController and then run it. Then drag down the view. The action cells are covered by the cancel view even the hideCollectionViewBehindCancelView is true.
When setting the hideCollectionViewBehindCancelView to false in SpotifyActionController. The effect is more obvious than the fist one. The initial offset is messed up.
This pr fix several issues about top inset and content offset:
contentHeight already contains the cancelView's height when it calculated in viewDidLoad. So there is no need to minus it again.
The minimum top inset is safeAreaInsets.top + 30. In other words, if the top inset is already greater than the minimum number, it should not plus the top value.
As mentioned above, contentHeight contains cancelView's height, and bottomInset contains the height as well, which case the incorrect initial content offset.
This pr fix several issues about top inset and content offset:
contentHeight
already contains the cancelView'sheight
when it calculated inviewDidLoad
. So there is no need to minus it again.safeAreaInsets.top + 30
. In other words, if the top inset is already greater than the minimum number, it should not plus the top value.contentHeight
contains cancelView'sheight
, andbottomInset
contains the height as well, which case the incorrect initial content offset.