Last active
May 18, 2022 13:06
-
-
Save meyusufdemirci/56c93c0f720f74945b9ff1185aa1decb to your computer and use it in GitHub Desktop.
Dynamic Alert and Sheet Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@StateObject private var viewModel: ViewModel = .init() | |
var body: some View { | |
ZStack { | |
Text("Hello, from the content view!") | |
} | |
.alert(item: self.$viewModel.alert) { $0.alert } | |
.sheet(item: self.$viewModel.sheet) { $0.view } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment