SwiftyDrawer

1.0.0

Customisable SwiftUI drawer component available on iOS 15+
aswinter90/SwiftyDrawer

What's New

v1.0.0

2025-11-23T15:38:34Z

What's Changed

  • The package received a major refactoring to make it work on iOS 26.1 simulators, on which the drawer would not be shown due to a rendering issue.
  • The DrawerBottomPosition enum was updated. The cases relativeToTabBar and matchesStickyHeaderContentHeightAlignedToTabBar were removed as the tab bar should be considered as part of the safe area, thus the now removed cases were redundant to the other cases relativeToSafeAreaBottom and matchesStickyHeaderContentHeightAlignedToSafeAreaBottom.
  • The drawer now correctly uses the provided backgroundColor of DrawerStyle. Note that it will not cast any shadows on the drawer content or on the views under the drawer if a transparent background color is chosen.

Full Changelog: v0.4.0...v1.0.0

SwiftyDrawer

This mostly SwiftUI-based customizable drawer component offers functionality similar to the standard sheet modifier, but with additional fixed positions and extensive customization options. Ideal for displaying expandable and scrollable content on top of a background view, akin to the drawer behavior seen in Apple's and Google's map applications.

This project is currently a work in progress, being developed sporadically. Future updates may include additional documentation and bug fixes.

🔩 Installation

You can add SwiftyDrawer to an Xcode project by adding it as a package dependency. The required minimum platform version is iOS 15.

From the File menu, select Add Package Dependencies... Enter "https://github.com/aswinter90/SwiftyDrawer" into the package repository URL text field.

Or add it to your Swift package by referencing it in your package manifest:

let package = Package(
    name: "MyLibrary",
    platforms: [.iOS(.v15)],
    products: [
        .library(
            name: "MyLibrary",
            targets: ["MyLibrary"]),

    ],
    dependencies: [
        .package(url: "https://github.com/aswinter90/SwiftyDrawer", from: "1.0.0")
    ],
    targets: [
        .target(
            name: "MyLibrary",
            dependencies: ["SwiftyDrawer"]
        ),
    ]
)

📱 Examples

The project contains multiple demo applications with showcases for displaying the SwiftyDrawer in different usage scenarios.

Minimal setup

image
import SwiftUI
import SwiftyDrawer

struct ContentView: View {
    @State private var drawerState = DrawerState(case: .partiallyOpened)

    var body: some View {
        MySwiftLogo()
            .drawerOverlay(
                state: $drawerState,
                content: {
                    VStack {
                        ForEach(0..<30) { index in
                            Text("Item \(index)")
                                .frame(maxWidth: .infinity, alignment: .leading)
                                .padding()

                            Divider()
                        }
                    }
                    .padding(.top, 8)
                }
            )
    }
}

As shown in the video the drawer can be modified with a sticky header, which stays on top of the safe area or the tab bar when the drawer is closed. The default drag handle can also be replaced with any other given view. Finally the DrawerState is mutable and changing it from the outside will update the drawer position automatically.

demo2.mov

This is a demonstration for how the drawer content can be updated by observing a ViewModel state.

map-demo-480p.mov

Description

  • Swift Tools 6.2.0
View More Packages from this Author

Dependencies

Last updated: Mon Jan 19 2026 05:19:35 GMT-1000 (Hawaii-Aleutian Standard Time)