donggyushin / DGSnackBar

Functional SnackBar that responds to the keyboard and shows a message at the bottom of the screen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

  1. DGSnackBar
  2. Requirements
  3. Installation
  4. Usage
  5. Properties

DGSnackBar

Functional SnackBar that responds to the keyboard and shows a message at the bottom of the screen.

Requirements

  • iOS 12.0+
  • Swift 5.5+
  • Xcode 10.0+

Installation

SPM

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

CocoaPod

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

Usage

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

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

About

Functional SnackBar that responds to the keyboard and shows a message at the bottom of the screen.

License:MIT License


Languages

Language:Swift 93.6%Language:Ruby 6.4%