Skip to content

Releases: michael94ellis/ToastWindow

API Design Update

09 Oct 01:13

Choose a tag to compare

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.View instead of a SwiftUI.View object itself
  • Consolidation of methods to invoke Toasts

Thanks for reading!

Documentation and ref update

22 Jun 14:03

Choose a tag to compare

Updated the documentation which displays in Xcode's SPM window

Initial Release

12 Jun 22:45

Choose a tag to compare

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