Фикс: race condition свайп-минимизации call bar + асимметричный transition оверлея
This commit is contained in:
@@ -39,7 +39,16 @@ final class CallBarInsetView: UIView {
|
||||
func applyInset() {
|
||||
guard topInset != lastAppliedInset else { return }
|
||||
guard let window, let rootVC = window.rootViewController else { return }
|
||||
Self.apply(inset: topInset, in: rootVC)
|
||||
let inset = topInset
|
||||
// Animate in sync with SwiftUI spring transition to avoid jerk.
|
||||
// layoutIfNeeded() forces the layout pass INSIDE the animation block —
|
||||
// without it, additionalSafeAreaInsets triggers layout on the next
|
||||
// run loop pass, which is outside the animation scope → instant jump.
|
||||
UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 0.85,
|
||||
initialSpringVelocity: 0, options: [.beginFromCurrentState]) {
|
||||
Self.apply(inset: inset, in: rootVC)
|
||||
rootVC.view.layoutIfNeeded()
|
||||
}
|
||||
lastAppliedInset = topInset
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user