elai950 / AlertToast

Create Apple-like alerts & toasts using SwiftUI
https://elai950.github.io/AlertToast/
MIT License
2.08k stars 187 forks source link

System image not being displayed when AlertToast added to a package. #77

Open antokne opened 1 year ago

antokne commented 1 year ago

Describe the bug When using AlertToast in a package, displaying a toast of displayMode type .alert neither a systemImage or Image are displayed.

To Reproduce Steps to reproduce the behavior:

  1. Add AlertToast into a package. and create a SwiftUI view
  2. Set up an alert eg:
.toast(isPresenting: $showToast) {
    AlertToast(displayMode: .alert, type: .systemImage("pause.circle", .red), style: .style(backgroundColor: .black))
}
  1. Verify that the system image does not display in preview.
  2. Change to .hud type. image does display.

Expected behavior System image should be visible.

Screenshots

Using .alert

image

Using .hud

image

Desktop (please complete the following information):

Verified this works when displaying in a SwiftUI view in app not in a package.