FloatingPanel
FloatingPanel copied to clipboard
Doubt on FloatingPanel.layoutAdapter.layout.initialPosition ?
When app launches floatingPanel.layoutAdapter.layout.initialPosition is half. After removing the panel from the parent using removePanelFromParent and adding same panel, the floatingPanel.layoutAdapter.layout.initialPosition is hidden . How could not figure out why is this happening ?
Custom Layout
class SearchIntrinsicLayout: FloatingPanelLayout {
var topInteractionBuffer: CGFloat { return 0.0 }
var bottomInteractionBuffer: CGFloat { return 0.0 }
func backdropAlphaFor(position: FloatingPanelPosition) -> CGFloat {
return 0.0
}
var initialPosition: FloatingPanelPosition {
return .half
}
var supportedPositions: Set<FloatingPanelPosition> {
return [.half,.full]
}
func insetFor(position: FloatingPanelPosition) -> CGFloat? {
switch position {
case .full: return 0
case .half: return 281
default: return nil
}
}
}
I'm sorry I don't know, but it's strange because SearchIntrinsicLayout.initialPosition is a readonly property so it's not possible for it to become hidden.