divadretlaw / CustomAlert

🔔 Custom Alert for SwiftUI
MIT License
196 stars 18 forks source link

EnvironmentObject not working in parent view #4

Closed axbeats closed 1 year ago

axbeats commented 1 year ago

Thanks for the effort building a custom alert, much appreciated.

There is an error when you have an EnvironmentObject in the parent view; when you activate the alert, the parent view loses access to the EnvironmentObject.

Cheers

divadretlaw commented 1 year ago

Hello, I'm not quite sure how to reproduce your mentioned issue? The parent view meaning the view with the .customAlert or the parent of the view where the .customAlert is attached?

Could you maybe provide a minimal reproducible example?

axbeats commented 1 year ago

I tried to reproduce the bug in a minimal example, and it all worked. Something else is wrong with my code that makes it lose access to the EnvironmentModel. Sorry to waste your time. Again, thank you very much for your good work!

divadretlaw commented 1 year ago

No worries, no time was wasted 😄