Releases: michael94ellis/ToastWindow
API Design Update
Non-breaking changes to the ToastWindow interface for summoning toast windows.
A special thanks to Seyed Mojtaba, https://github.com/MojtabaHs, for some design tweaks that enhance the design of this library.
- The default duration for toasts will now be 2.5, pass in nil to allow the toast to persist indefinitely
- Pass in a closure that returns a
SwiftUI.Viewinstead of aSwiftUI.Viewobject itself - Consolidation of methods to invoke Toasts
Thanks for reading!
Documentation and ref update
Updated the documentation which displays in Xcode's SPM window
Initial Release
Support for SwiftUI Toasts using UIKit's UIWindow class.
Toasts presented with this library will be tappable, swipeable, animatable, and fully controllable using SwiftUI APIs. See the repo for examples!
All that this library does is create a UIWindow and place your content inside it, then it will clean up behind itself when your toast is dismissed.
Use the Environment Values to make it easy to use!
/// Display Toasts
@Environment(.toastManager) var toastManager
/// Dismiss A Specific Toast if you show multiple
@Environment(.dismissToast) var dismissToast: ((ToastID) -> Void)
/// Dismiss All Toasts
@Environment(.dismissAllToasts) var dismissToast: (() -> Void)
Please star the repo, leave feedback in the Issues section, or Fork and contribute! Thanks