scenee / FloatingPanel

A clean and easy-to-use floating panel UI component for iOS
MIT License
5.61k stars 509 forks source link

Fix the backdrop alpha issue (#572) #573

Closed scenee closed 2 years ago

scenee commented 2 years ago

This fixes https://github.com/scenee/FloatingPanel/issues/572. The main change is that true is passed as a forceLayout parameter into viewWillTransition(to:with:) callbacks.

Because it's necessary for the backdrop alpha's update when the view size or its size classes changes.

This also fixes a regression by https://github.com/scenee/FloatingPanel/commit/9c45c311901b90be90653aff63871ea751fae171.

-        layoutAdapter.activateLayout(for: state, forceLayout: true)
+        layoutAdapter.activateLayout(for: state, forceLayout: forceLayout)

The behavior before the above second change indicates that the method is working well even when forceLayout is set to true in their callbacks.