Fix unexpected assertion failure

This commit is contained in:
Shin Yamamoto
2018-12-04 08:19:41 +09:00
parent 5cc3d4fbfb
commit d469caad69
2 changed files with 3 additions and 6 deletions
@@ -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 }
+2 -6
View File
@@ -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")
}