Fix unexpected assertion failure
This commit is contained in:
@@ -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 }
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user