let toast = Toast.text("Safari pasted from Notes", subtitle: "A few seconds ago")
toast.delegate = self
toast.show()
Below delegate functions are optional to implement when implementing ToastDelegate.
extension MyViewController: ToastDelegate {
func willShowToast(_ toast: Toast) {
print("Toast will be shown after this")
}
func didShowToast(_ toast: Toast) {
print("Toast was shown")
}
func willCloseToast(_ toast: Toast) {
print("Toast will be closed after this")
}
func didCloseToast(_ toast: Toast) {
print("Toast was closed (either automatically, dismissed by user or programmatically)")
}
}
Adds a
ToastDelegate
per requested in https://github.com/BastiaanJansen/toast-swift/issues/16Usage
Below delegate functions are optional to implement when implementing
ToastDelegate
.Fixes https://github.com/BastiaanJansen/toast-swift/issues/16