Latest 1.0.2
Homepage https://github.com/Shubhank101/SGSnackBar
License MIT
Platforms ios 8.0, requires ARC
Authors

Requirements

Xcode 9.0+ and Swift 4.0

To use swift 2.0 version, please use 1.0.1 cocoapod version or swift 2 tag of the repo

Info

A android material style snackbar lib for iOS. Can be used to show as a simple toast or for more complicated operations like undo a mail delete etc.
Auto dismisses after the duration you set so easy management from code point of view.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Show the snackbar on any view or window

self.view.showSnackbar(message: "My Snackbar message", duration: SnackbarDuration.SHORT, actionButtonText: "OK") { () -> () in
Params
message                     - Text to show in the snackbar message
duration                    - SHORT - 4 second or LONG - 7 second
actionButtonText            - optional - if set shows the action button
actionButtonClickHandler    - Swift closure that is executed when user presses the action button
UIAppearance
SGSnackBarView.appearance().actionButtonBackgroundColor
SGSnackBarView.appearance().descLabelTextColor
SGSnackBarView.appearance().snackBarBgColor
SGSnackBarView.appearance().actionButtonTextColor

All of the above can be set to display custom snackbar.

Demo

Demo

Installation

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

pod "SGSnackBar"

Author

Shubhank Gupta, [email protected]

License

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

Latest podspec

{
    "name": "SGSnackBar",
    "version": "1.0.2",
    "summary": "An Android snackbar type information toast/popup",
    "description": "A highly customizable view similar to android snackbar which can be shown to show user simple toast updates that auto dismiss, or show with a action button to get user feedback for simple cases like : undo a message delete, show push notification content and get user action and so on.",
    "homepage": "https://github.com/Shubhank101/SGSnackBar",
    "license": "MIT",
    "authors": {
        "Shubhank Gupta": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Shubhank101/SGSnackBar.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This