All Projects → adamfootdev → BottomSheet

adamfootdev / BottomSheet

Licence: MIT license
Access UISheetPresentationController in SwiftUI on iOS 15 using a simple .bottomSheet modifier.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to BottomSheet

About Swiftui
Gathering all info published, both by Apple and by others, about new framework SwiftUI.
Stars: ✭ 5,954 (+1693.37%)
Mutual labels:  uikit, swiftui
swiftui-example
SwiftUI 示例,技巧和技术集合,帮助我构建应用程序,解决问题以及了解SwiftUI的实际工作方式。
Stars: ✭ 109 (-67.17%)
Mutual labels:  uikit, swiftui
Render
UIKit a-là SwiftUI.framework [min deployment target iOS10]
Stars: ✭ 2,150 (+547.59%)
Mutual labels:  uikit, swiftui
CurrencyText
Currency text field formatter available for UIKit and SwiftUI 💶✏️
Stars: ✭ 124 (-62.65%)
Mutual labels:  uikit, swiftui
StoreHelper
Implementing and testing In-App Purchases with StoreKit2 and StoreHelper in Xcode 13, Swift 5.5, SwiftUI, iOS 15 and macOS 12.
Stars: ✭ 158 (-52.41%)
Mutual labels:  swiftui, ios15
Swiftui Cheat Sheet
SwiftUI 2.0 Cheat Sheet
Stars: ✭ 3,417 (+929.22%)
Mutual labels:  uikit, swiftui
SheeKit
Customize and resize sheets in SwiftUI with SheeKit. Utilise the power of `UISheetPresentationController` and other UIKit features.
Stars: ✭ 56 (-83.13%)
Mutual labels:  uikit, swiftui
column-text-view-ui
📄 Column Text View is an adaptive UI component that renders text in columns, horizontally [iOS 12, UIKit, TextKit, SwiftUI].
Stars: ✭ 11 (-96.69%)
Mutual labels:  uikit, swiftui
Builder
Demonstrates SwiftUI builder patterns for UIKit and networking.
Stars: ✭ 100 (-69.88%)
Mutual labels:  uikit, swiftui
BoxFeed
News App 📱 built to demonstrate the use of SwiftUI 3 features, Async/Await, CoreData and MVVM architecture pattern.
Stars: ✭ 112 (-66.27%)
Mutual labels:  swiftui, ios15
NativeMarkKit
NativeMark is a flavor of Markdown designed to be rendered by native apps.
Stars: ✭ 36 (-89.16%)
Mutual labels:  uikit, swiftui
UIViewPreviewProvider
Allows displaying UIViews inside the Xcode preview canvas
Stars: ✭ 36 (-89.16%)
Mutual labels:  uikit, swiftui
Movie Trailers SwiftUI
A simple app which shows the lastest movies trailers based on different genres developed using SwiftUI.
Stars: ✭ 51 (-84.64%)
Mutual labels:  uikit, swiftui
Swift Composable Architecture
A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
Stars: ✭ 5,199 (+1465.96%)
Mutual labels:  uikit, swiftui
ColorUp
An easy way to generate strongly typed Swift extensions for either UIColor or Color based off of your colors within the project's asset catalog.
Stars: ✭ 16 (-95.18%)
Mutual labels:  uikit, swiftui
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (-13.86%)
Mutual labels:  uikit, swiftui
SwiftUIKit
📱 UIKit code that is fun to write
Stars: ✭ 71 (-78.61%)
Mutual labels:  uikit, swiftui
Redux
Manage iOS App state with Redux and Async/Await :)
Stars: ✭ 18 (-94.58%)
Mutual labels:  uikit, swiftui
VCore
VCore is a Swift collection containing objects, functions, and extensions that I use for my projects
Stars: ✭ 32 (-90.36%)
Mutual labels:  uikit, swiftui
NavigationRouter
A router implementation designed for complex modular apps, written in Swift
Stars: ✭ 89 (-73.19%)
Mutual labels:  uikit, swiftui

BottomSheet

Feature Graphic Platform

BottomSheet makes it easy to take advantage of the new UISheetPresentationController in SwiftUI with a simple .bottomSheet modifier on existing views.

  1. Requirements
  2. Integration
  3. Usage

Requirements

  • iOS 15+
  • Xcode 13+

Integration

Swift Package Manager

BottomSheet can be added to your app via Swift Package Manager in Xcode using the following configuration:

dependencies: [
    .package(url: "https://github.com/adamfootdev/BottomSheet.git", from: "0.1.3")
]

Usage

To get started with BottomSheet, you'll need to import the framework first:

import BottomSheet

Presenting the Sheet

You can then apply the .bottomSheet modifier to any SwiftUI view, ensuring you attach a binding to the isPresented property - just like the standard .sheet modifier:

.bottomSheet(isPresented: $isPresented) {
    Text("Hello, world!")
}

BottomSheet also supports passing an Optional item to it, displaying the sheet if the item is not nil:

.bottomSheet(item: $item) {
    Text("Hello, world!")
}

Customizing the Sheet

BottomSheet can be customized in the same way a UISheetPresentationController can be customized in UIKit. This is done by specifying additional properties in the modifier:

.bottomSheet(
    isPresented: $isPresented,
    detents: [.medium(), .large()],
    largestUndimmedDetentIdentifier: .large,
    prefersGrabberVisible: true,
    prefersScrollingExpandsWhenScrolledToEdge: true,
    prefersEdgeAttachedInCompactHeight: false,
    widthFollowsPreferredContentSizeWhenEdgeAttached: false,
    onDismiss: { print("Dismissed") }
) {
    Text("Hello, world!")
}

For more information on UISheetPresentationController, read Apple's documentation: https://developer.apple.com/documentation/uikit/uisheetpresentationcontroller

Please note BottomSheet is currently missing the ability to be resized programmatically as the delegate doesn't work in iOS 15 beta 1. You may also run into issues when used on an iPad with multi-window support and have multiple instances of the same app side-by-side running.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].