A flexible and easy to use Snackbar control for iOS.
Flexible, easy to use and customizable.
Snacks are actionable.
Snacks are stackable and swipeable.
Supports iOS 8.0 +
Written with the latest Swift (Swift 4)
Install CocoaPods.
Add this pod to your Podfile
.
target 'Example' do
use_frameworks!
pod 'LPSnackbar'
end
Run pod install
.
Open up the .xcworkspace
that CocoaPods created.
Import LPSnackbar
into any source file where it's needed.
Snacks can be simple
// Yes, this simple.
LPSnackbar.showSnack(title: "I'm a snack!")
Snacks can be customized
let snack = LPSnackbar(title: "Object deleted.", buttonTitle: "UNDO")
// Customize the snack
snack.bottomSpacing = (tabBarController?.tabBar.frame.height ?? 0) + 15
snack.view.titleLabel.font = UIFont.systemFont(ofSize: 20)
// Show a snack to allow user to undo deletion
snack.show(animated: true) { (undone) in
if undone {
// Undo deletion
} else {
// Follow through with deletion
}
}
Download and run the example project
Full documentation available here