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
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.
To run the example project, clone the repo, and run pod install
from the Example directory first.
self.view.showSnackbar(message: "My Snackbar message", duration: SnackbarDuration.SHORT, actionButtonText: "OK") { () -> () in
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
SGSnackBarView.appearance().actionButtonBackgroundColor
SGSnackBarView.appearance().descLabelTextColor
SGSnackBarView.appearance().snackBarBgColor
SGSnackBarView.appearance().actionButtonTextColor
All of the above can be set to display custom snackbar.
SGSnackBar is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SGSnackBar"
Shubhank Gupta, [email protected]
SGSnackBar is available under the MIT license. See the LICENSE file for more info.