Customizable Dynamic Bottom Sheet Library for iOS

Overview

DynamicBottomSheet

Powerd by Witi Corp., Seoul, South Korea.

Platform Language: Swift 5 SwiftPM compatible CocoaPods compatible Version License

Fully Customizable Dynamic Bottom Sheet Library for iOS.

This library doesn't support storyboards.

However, you can easily override variables in DynamicBottomSheetViewController and make the bottom sheet programmatically.

Preview

Preview

Requirements

  • Swift 5

  • iOS 10.0 +

  • RxSwift 6.0

  • RxCocoa 6.0

  • RxGesture 4.0

  • SnapKit 5.0

  • Then 2.0

Installation

CocoaPods

DynamicBottomSheet is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'DynamicBottomSheet'
$ pod install

Swift Package Manager(SPM)

In Xcode, add as Swift package with this URL: https://github.com/Witi-Official/DynamicBottomSheet

Usage

  1. Import DynamicBottomSheet on top of your view controller file.

  2. Create a class for the bottom sheet where its super class is DynamicBottomSheetViewController.

  3. Put the view you want to show in the contentView of the super class DynamicBottomSheetViewController.

  4. Make constraints of the view you made to the contentView above.

  5. Present the bottom sheet view controller you made before in another view controller.

Example

For more examples, clone the repo, and run pod install from the Example directory.

import UIKit
import DynamicBottomSheet
import SnapKit
import Then

class MyStackViewBottomSheetViewController: DynamicBottomSheetViewController {

    // MARK: - Private Properties

    private let stackView = UIStackView()
        .then {
            $0.axis = .vertical
            $0.spacing = 32
            $0.alignment = .fill
            $0.distribution = .fillEqually
        }

}

// MARK: - Layout

extension MyStackViewBottomSheetViewController {

    override func configureView() {
        super.configureView()
        layoutStackView()
    }

    private func layoutStackView() {

        contentView.addSubview(stackView)
        stackView.snp.makeConstraints {
            $0.top.equalToSuperview().offset(16)
            $0.leading.equalToSuperview().offset(16)
            $0.trailing.equalToSuperview().offset(-16)
            $0.bottom.equalTo(view.safeAreaLayoutGuide).offset(-16)
        }

        Array(1...5).forEach {

            let label = UILabel()
            label.text = "\($0)"
            stackView.addArrangedSubview(label)

        }

    }

}
import UIKit

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        let bottomSheet = MyStackViewBottomSheetViewController()
        DispatchQueue.main.async {
            self.present(bottomSheet)
        }
    }
}

Customization

/// The background color of the view controller below the content view.
///
/// - `UIColor.black.withAlphaComponent(0.6)` for others.
open var backgroundColor: UIColor

/// Background view
open var backgroundView: UIView

/// The background color of the content view.
///
/// Default value
/// - `UIColor.tertiarySystemBackground` for iOS 13 or later.
/// - `UIColor.white` for others.
open var contentViewBackgroundColor: UIColor

/// The height of the content view.
///
/// Default value is `nil`
///
/// If you set this value explicitly, the height of the content view will be fixed.
open var height: CGFloat?

/// Content view
open var contentView: UIView

/// Corner radius of the content view(top left, top right)
///
/// Default value is `16.0`
open var contentViewCornerRadius: CGFloat

/// Present / Dismiss transition duration
///
/// Default value is 0.3
open var transitionDuration: CGFloat

/// Dismiss velocity threshold
///
/// Default value is 500
open var dismissVelocityThreshold: CGFloat

Author

Aaron Lee at Witi Corp., [email protected]

License

DynamicBottomSheet is available under the MIT license. See the LICENSE file for more info.

You might also like...
TTGSnackbar shows simple message and action button on the bottom or top of the screen with multi kinds of animation, which is written in Swift3 and inspired by Snackbar in Android. It also support showing custom view, icon image or multi action button. A Google like action sheet for iOS written in Swift.
A Google like action sheet for iOS written in Swift.

MaterialActionSheetController Lightweight and totally customizable. Create and present it the way you do with UIAlertController. Screenshots Demo | De

This is a small View modifier that adds detents for native .sheet representations that appeared in iOS 16

SheetDetentsModifier This is a small View modifier that adds detents for .sheet representations that appeared in iOS 16 It works starting with iOS 15

Dice roller, character sheet/ creator, and monster/item info app on the iphone12

DnD-LordDogMaw This file will be the start of a side project in the hopes of creating an iphone12 app for Dungeons and Dragons! This app will have 3 m

Action sheet allows including your custom views and buttons.
Action sheet allows including your custom views and buttons.

CustomizableActionSheet Action sheet allows including your custom views and buttons. Installation CocoaPods Edit your Podfile: pod 'CustomizableAction

Present a sheet ViewController easily and control ViewController height with pangesture
Present a sheet ViewController easily and control ViewController height with pangesture

PanControllerHeight is designed to present a sheet ViewController easily and control ViewController height with pangesture.

Share-sheet-example - A sample project that reproduces an issue with Share Sheets

Hello, DTS! This project demonstrates the issue I'm having with the Share Sheet.

SplitSheet - A lightweight, fully interactive split-screen sheet.
SplitSheet - A lightweight, fully interactive split-screen sheet.

SplitSheet A lightweight, fully interactive split-screen sheet. Powered by UIScrollView for super-smooth gestures. Show/hide either programmatically o

The easiest way to display highly customizable in app notification banners in iOS
The easiest way to display highly customizable in app notification banners in iOS

Written in Swift 5 NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banne

Releases(1.0.2)
A SwiftUI Partial Sheet fully customizable with dynamic height

A SwiftUI Partial Sheet fully customizable with dynamic height

Andrea Miotto 1.4k Jan 5, 2023
DGBottomSheet - The lightest swift bottom sheet library

DGBottomSheet Requirements Installation Usage DGBottomSheet The lightest swift b

donggyu 9 Aug 6, 2022
SwiftUI Draggable Bottom Sheet

SwiftUI Draggable Bottom Sheet

paigeshin 2 Mar 3, 2022
Bottom Sheet component is widely used in Joom application

Bottom Sheet Bottom Sheet component is widely used in Joom application Installation Swift Package Manager Swift Package Manager is a tool for managing

Joom 101 Dec 29, 2022
BottomSheetDemo - Bottom sheet modal view controller with swift

当我们想弹出一个预览视图,bottom sheet modal view controller 非常实用。在 iOS 中,长按拖拽手势可以让 controlle

null 8 Oct 29, 2022
Custom-action-sheet- - Custom action sheet with swift

Custom-action-sheet- Usage let alertController: UIAlertControllerDimmed = UIAler

Girisankar G 0 Jan 19, 2022
Fully customizable and extensible action sheet controller written in Swift

XLActionController By XMARTLABS. XLActionController is an extensible library to quickly create any custom action sheet controller. Examples The action

xmartlabs 3.3k Dec 31, 2022
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

Wouter 63 Jan 5, 2023
A Swift library to provide a bouncy action sheet

Hokusai is a Swift library that provides a bouncy action sheet. It will give the users a fancy experience without taking pains coding the cool animati

Yuta Akizuki 430 Nov 20, 2022
BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps.

BottomSheet About BottomSheet BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps. The result can look like this...or completel

Daniel Saidi 174 Jan 2, 2023