TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2015 |
SPMSupports SPM | ✗ |
Maintained by Cam Clendenin.
A handy Swift toolbar-like widget for quickly displaying status updates and errors at the bottom of the screen. See the Android snackbar, which this is named after.
Without blocking the main UI:
let snackbar = Snackbar()
view.addSubview(snackbar)
// Start some long-running task...
snackbar.updateWithStatus("Syncing Data", message: "This may take a moment...")
// If/when that task finishes...
snackbar.completeWithStatus("Syncing Complete", message: "Your data seems to all be here.")
// If the tasks fails, you can handle the error like so...
snackbar.updateWithError("Error",
message: error.localizedDescription,
actionOptions: (buttonTitle: "RETRY", statusTitle: "Retrying", statusMessage: "Sit tight...", onSelect: { Void in
// fetchData()
})
)