Floating panel UI like Apple Maps' drawer, for iOS in UIKit and SwiftUI
open sourceMITfree
FloatingPanel is an iOS library for the floating panel interface seen in Apple Maps, Shortcuts and Stocks: a sheet that shows related content beside the main view and snaps between anchors such as full, half and tip. It's a container view controller with spring-based movement, scroll view tracking, removal gestures, several panels at once, modal presentation, panels on any of the four edges, and a surface, backdrop and grabber handle, with SwiftUI and Objective-C APIs as well as UIKit. It needs iOS 15 or later and installs with Swift Package Manager or CocoaPods.
Problems it solves
- add a draggable bottom drawer like Apple Maps to my iOS app
- show a half-height sheet that snaps open over a map in SwiftUI
- build a floating panel that tracks a scroll view inside it on iOS
Features
- Panels that snap between magnetic anchors such as full, half and tip
- Spring-based movement, scroll view tracking and swipe-to-remove
- Several panels at once and modal presentation
- Panels on the top, left, bottom or right edge
- Surface, backdrop and grabber handle built in
- SwiftUI, UIKit and Objective-C APIs
