by VerifiedReports · 3mo ago · 0 comments
And I will have another look at @Environment; I guess I'm thinking of @EnvironmentObject, which is a hack that I'd never choose over a singleton. My only current exposure to @Environment is as a workaround to other missing functions or properties, like this on a custom button:
@Environment(\.isEnabled) private var isEnabled
Or to allow a view to dismiss itself:
@Environment(\.dismiss) private var dismiss
No comments yet.