Functional SnackBar that responds to the keyboard and shows a message at the bottom of the screen.
- iOS 12.0+
- Swift 5.5+
- Xcode 10.0+
File > Add Packages > https://github.com/donggyushin/DGSnackBar
pod 'DGSnackBar', :git => 'https://github.com/donggyushin/DGSnackBar.git'
DGSnackBar.shared.showToast("Hi") {
print("Add here a function that you want to execute when user tapped the snackbar view")
}
// If you want to show SnackBar with title message
DGSnackBar.shared.showToast("Description text", "Title text")
Properties | Description | Default | Type |
---|---|---|---|
backgroundColor | Snackbar's background color | .black | UIColor |
textColor | Snackbar's text color | .white | UIColor |
duration | Snackbar's visual duration time | 2.5 | CGFloat |
textAlignment | Snackbar's description text alignement | .natural | NSTextAlignment |
titleTextAlignment | Snackbar's title text alignment | .natural | NSTextAlignment |
alpha | Snackbar's alpha | 0.8 | CGFloat |
cornerRadius | Snackbar's border radius | 10 | CGFloat |