SwiftUI-Drawer A bottom-up drawer view.

Related tags

UI SwiftUI-Drawer
Overview

SwiftUI-Drawer

A bottom-up drawer view.

Contents

Installation

For Swift Packages

Add a dependency in your your Package.swift file

    .package(name: "Drawer", url: "https://github.com/bwide/SwiftUI-Drawer", from: "1.1.1")

Examples

Simple Drawer with no handle

        ZStack {
            Color.black
            GeometryReader {
                Drawer {
                    EmptyView()
                }
                .background(color: .blue)
                .rest(in: [135, $0.size.height])
            }
        }.edgesIgnoringSafeArea(.vertical)







Drawer with the default handle
        ZStack {
            Color.black
            GeometryReader {
                Drawer({
                    EmptyView()
                }, handle: {
                    DrawerHandles.defaultHandle
                })
                .background(color: .blue)
                .handle(height: 6, padding: 10)
                .rest(in: [135, $0.size.height])
            }
        }.edgesIgnoringSafeArea(.vertical)







Drawer with no rounded edges when reaching the top of the screen and a custom handle offset

        GeometryReader { geometry in
            Drawer({
                EmptyView()
            }, handle: {
                DrawerHandles.defaultHandle
            })
            .cornerRadius(radius)
            .onRest({ position in
                radius = position == geometry.size.height
                    ? 0
                    : 16
            })
            .onDrag({ _ in
                radius = 16
            })
            .background(color: .blue)
            .rest(in: [136, geometry.size.height])
            .handle(height: 6, padding: 10)
        }







Drawer with scrollable content

        ZStack {
            Color.black
            GeometryReader {
                Drawer({
                    ZStack {
                        Color.blue
                        VStack {
                            ForEach(0..<100) {
                                Text("item \($0)")
                            }
                        }
                    }
                }, handle: {
                    DrawerHandles.defaultHandle
                })
                    .scrollableContent()
                    .background(color: .blue)
                    .handle(height: 6, padding: 10)
                    .rest(in: [135, $0.size.height])
                    .interactive(in: [$0.size.height])
            }
        }.edgesIgnoringSafeArea(.vertical)
You might also like...
A SwiftUI Library for creating resizable partitions for View Content.
A SwiftUI Library for creating resizable partitions for View Content.

Partition Kit Recently Featured In Top 10 Trending Android and iOS Libraries in October and in 5 iOS libraries to enhance your app! What is PartitionK

Advanced List View for SwiftUI with pagination & different states

AdvancedList This package provides a wrapper view around the SwiftUI List view which adds pagination (through my ListPagination package) and an empty,

📖   A lightweight, paging view solution for SwiftUI
📖 A lightweight, paging view solution for SwiftUI

Getting Started | Customization | Installation Getting Started Basic usage Using Pages is as easy as: import Pages struct WelcomeView: View { @S

SwiftUI view enabling navigation between pages of content, imitating the behaviour of UIPageViewController for iOS and watchOS
SwiftUI view enabling navigation between pages of content, imitating the behaviour of UIPageViewController for iOS and watchOS

PageView SwiftUI view enabling page-based navigation, imitating the behaviour of UIPageViewController in iOS. Why SwiftUI doesn't have any kind of pag

🚀  Elegant Pager View fully written in pure SwiftUI.
🚀 Elegant Pager View fully written in pure SwiftUI.

PagerTabStripView Made with ❤️ by Xmartlabs team. XLPagerTabStrip for SwiftUI! Introduction PagerTabStripView is the first pager view built in pure Sw

A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI.

A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI. Many of these helpers are useful even in a pure UIKit project.

Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it.
Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it.

SwiftUI TagView Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it. Usage: Just copy the

Demonstrate the toolbar view modifier for SwiftUI with different placements
Demonstrate the toolbar view modifier for SwiftUI with different placements

ToolbarProject Demonstrate the toolbar view modifier for SwiftUI with different placements Youtube tutorial -- https://youtu.be/jTW5Z-kyL8g Use toolb

A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View

ScrollViewIfNeeded A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View Installation Requirements iOS 13+ Swift Package Manag

Owner
Perimeter AI Inc.
Perimeter AI Inc.
⬆️ A SwiftUI view component sliding in from bottom

⬆️ A SwiftUI view component sliding in from bottom

Tieda 595 Dec 28, 2022
🐝 Super ultra drawer view

UltraDrawerView let headerView = HeaderView() headerView.translatesAutoresizingMaskIntoConstraints = false headerView.heightAnchor.constraint(equalToC

Ilya Lobanov 205 Dec 14, 2022
A SwiftUI bottom-up controller, like in the Maps app. Drag to expand or minimize.

SwiftUI Drawer A SwiftUI bottom-up controller, like in the Maps app. Drag to expand or minimize. Contents Add the Package Basic Usage Examples Credits

Michael Verges 695 Jan 3, 2023
The Napp Drawer module extends the Appcelerator Titanium Mobile framework.

Titanium Napp Drawer Module Description The Napp Drawer module extends the Appcelerator Titanium Mobile framework. The module is licensed under the MI

null 12 Sep 15, 2022
BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen

BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen. It is especially well

Alexis (Aubry) Akers 5.3k Jan 2, 2023
A paging scroll view for SwiftUI, using internal SwiftUI components

PagingView A paging scroll view for SwiftUI, using internal SwiftUI components. This is basically the same as TabView in the paging mode with the inde

Eric Lewis 18 Dec 25, 2022
SwiftUI-Margin adds a margin() viewModifier to a SwiftUI view.

SwiftUI-Margin adds a margin() viewModifier to a SwiftUI view. You will be able to layout the margins in a CSS/Flutter-like.

Masaaki Kakimoto(柿本匡章) 2 Jul 14, 2022
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Jogendra 772 Dec 28, 2022
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Or Ron 234 Nov 22, 2022