Skip to content

A flexible and easy to use Snackbar control for iOS.

License

Notifications You must be signed in to change notification settings

carlosDigio/LPSnackbar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LPSnackbar

Features

  • Flexible, easy to use and customizable.
  • Snacks are stackable and swipeable.
  • Snacks are actionable.
  • Supports iOS 11.0 +
  • Written with the latest Swift (Swift 5)

Installation

Cocoapods (recommended)

  1. Install CocoaPods.

  2. Add this pod to your Podfile.

    target 'Example' do
      use_frameworks!
    
      pod 'LPSnackbar'
    end
  3. Run pod install.

  4. Open up the .xcworkspace that CocoaPods created.

  5. Import LPSnackbar into any source file where it's needed.

From Source

  1. Simply download the source from here and add it to your Xcode project.

Usage

Snacks can be simple

// Yes, this simple.
let snackbar = LPSnackbarManager.createSnackBar(title: "I'm a snack!")
snackbar.viewToDisplayIn = view

LPSnackbarManager.show(snackBar: snackbar)

Snacks can be customized

let snackbar = LPSnackbarManager.createSnackBar(title: text, buttonTitle: "Undo", delegate: self)
snackbar.viewToDisplayIn = view
snackbar.bottomSpacing = (tabBarController?.tabBar.frame.height ?? 0) + 12
snackbar.adjustsPositionForSafeArea = false

LPSnackbarManager.show(snackBar: snackbar)

Example

Download and run the example project

Documentation

Full documentation available here

About

A flexible and easy to use Snackbar control for iOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 95.8%
  • Ruby 2.6%
  • Objective-C 1.1%
  • Shell 0.5%