diff --git a/Framework/Sources/FloatingPanelController.swift b/Framework/Sources/FloatingPanelController.swift index 2b782c4..dd5a9fe 100644 --- a/Framework/Sources/FloatingPanelController.swift +++ b/Framework/Sources/FloatingPanelController.swift @@ -219,6 +219,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI private func updateLayout(for traitCollection: UITraitCollection) { floatingPanel.layoutAdapter.layout = fetchLayout(for: traitCollection) + floatingPanel.layoutAdapter.checkLayoutConsistance() guard let parent = parent else { return } diff --git a/Framework/Sources/FloatingPanelLayout.swift b/Framework/Sources/FloatingPanelLayout.swift index 91464d9..b0244b4 100644 --- a/Framework/Sources/FloatingPanelLayout.swift +++ b/Framework/Sources/FloatingPanelLayout.swift @@ -110,11 +110,7 @@ class FloatingPanelLayoutAdapter { private weak var surfaceView: FloatingPanelSurfaceView! private weak var backdropView: FloatingPanelBackdropView! - var layout: FloatingPanelLayout { - didSet { - checkLayoutConsistance() - } - } + var layout: FloatingPanelLayout var safeAreaInsets: UIEdgeInsets = .zero { didSet { @@ -304,7 +300,7 @@ class FloatingPanelLayoutAdapter { assert(layout.insetFor(position: pos) != nil, "Undefined an inset for a pos(\(pos))") } - guard !(layout is FloatingPanelIntrinsicLayout) else { return } + if halfInset > 0 { assert(halfInset > tipInset, "Invalid half and tip insets") }