The lightest swift bottom sheet library

  1. DGBottomSheet
  2. Requirements
  3. Installation
  4. Usage

DGBottomSheet

The lightest swift bottom sheet library

Requirements

  • iOS 12.0+
  • Swift 5.0+
  • Xcode 10.0+

Installation

SPM

File > Add Packages > https://github.com/donggyushin/DGBottomSheet

CocoaPod

pod 'DGBottomSheet', :git => 'https://github.com/donggyushin/DGBottomSheet'

Usage

func showBottomSheet() {
    let contentsView: UIView = {
        let view = UIView()
        view.translatesAutoresizingMaskIntoConstraints = false
        // You should give view height constraint anyway
        view.heightAnchor.constraint(equalToConstant: 300).isActive = true
        view.backgroundColor = .white
        return view
    }()
    let vc = DGBottomSheet(view: contentsView)
    // Make sure animated false 
    self.present(vc, animated: false)
}

GitHub

View Github