2.0.0
FloatingPanel 2.0 is the latest major release of FloatingPanel. As a major release, following Semantic Versioning conventions, 2.0 introduces API-breaking changes.
The migration guide is provided in order to ease the transition of existing applications using FloatingPanel 1.x to the latest APIs, as well as explain the design and structure of new and updated functionality.
Thank you for all users and contributors of this library. This version has been completed with your contributions and feedback. I continue to welcome your feedback.
Environment updates
- Swift 5.0 or later
- iOS 11 or later(iOS 10 might be working)
- Update the directory structure and file names
Feature updates
- Support top, left and right positions of the panel
- Add ObjC compatibility
- Improve the layout customization
- Improve the behavior customization to handle it like UIScrollView
- Improve the remove interaction
- Fix many issues depending on API design
API updates
FloatingPanelController
- Replace
surfaceOriginY
withsurfaceLocation
- Enable to update
layout
andbehavior
directly - Update scroll tracking API a bit to support multiple scroll view tracking in the future.
- Replace
FloatingPanelControllerDelegate
- Change
floatingPanel(_:didMove:)
behavior which is also called in the spring animation. - Update removal interaction delegate
- Enable a panel to invoke the removal action at any state(position)
- Add
floatingPanel(_:shouldRemoveAt:with:)
to determine whether it invokes the removal interaction.
- Add
floatingPanelDidEndDragging(_ vc:willAttract:)
- Change
FloatingPanelLayout
- Introduce
FloatingPanelLayoutAnchoring
for the more flexible layout.- Add a factional panel position in the
FloatingPanelController
view - Replace
FloatingPanelFullScreenLayout
andFloatingPanelIntrinsicLayout
- Add a factional panel position in the
- Introduce
FloatingPanelBehavior
- Introduce the new spring effect using Numeric springing
- Add properties to contorl numeric springing
- Remove
.topInteractionBuffer/.bottomInteractionBuffer
- You can control the panel max/min position in
floatingPanel(_:didMove:)
delegate method
- You can control the panel max/min position in
SurfaceView
- Use
SurfaceAppearnace
to specify the rounding corners, shadow and background color.
- Use
FloatingPanelPanGestureRecognizer
- Add
delegateProxy
to intercept the gesture recognizer delegate.
- Add
- Improve API naming
FloatingPanelPosition
is nowFloatingPanelState
- Now
FloatingPanelPosition
is used to specify the panel positioning in a screen.
- Now
FloatingPanelGrabberHandleView
is nowGrabberView
(Swift only)FloatingPanelSurfaceView
is nowSurfaceView
(Swift only)FloatingPanelBackdropView
is nowBackdropView
(Swift only)- "decelerate" term is replaced with "attract" because the spring behavior is actually magnetic
- Misc
- Add
UISpringTimingParameters(decelerationRate:frequencyResponse:initialVelocity:)
- Add
Behavior updates
- Layout
- FloatingPanel doesn't disable constraints to Safe area in a content view so that the behavior of a content view always respects Safe area which is global in a screen. If it's not clear, please try Samples.app > Detail Panel and swipe it up to full state.
- BackdropView
- Disable the dismissal action of backdrop by default
- You can enable it to set
fpc.backdropView.dismissalTapGestureRecognizer.isEnabled = true
- You can enable it to set
- Disable the dismissal action of backdrop by default