https://github.com/donggyushin/dgbottomsheet
The lightest swift bottom sheet library
https://github.com/donggyushin/dgbottomsheet
bottomsheet ios swift
Last synced: 4 months ago
JSON representation
The lightest swift bottom sheet library
- Host: GitHub
- URL: https://github.com/donggyushin/dgbottomsheet
- Owner: donggyushin
- License: mit
- Created: 2022-01-12T12:57:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-30T16:16:32.000Z (over 3 years ago)
- Last Synced: 2025-06-15T09:09:45.202Z (4 months ago)
- Topics: bottomsheet, ios, swift
- Language: Swift
- Homepage:
- Size: 29.3 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
1. [DGBottomSheet](#DGBottomSheet)
2. [Requirements](#Requirements)
3. [Installation](#Installation)
4. [Usage](#Usage)# DGBottomSheet
The lightest swift bottom sheet library![]()
## Requirements
- iOS 12.0+
- Swift 5.5+
- Xcode 10.0+## Installation
### SPM
```
File > Add Packages > https://github.com/donggyushin/DGBottomSheet
```### CocoaPod
```
pod 'DGBottomSheet', :git => 'https://github.com/donggyushin/DGBottomSheet.git'
```## 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)
}// You can also hide DGBottomSheet programmatically
let vc = DGBottomSheet(view: contentsView)
vc.hide()
```