Created
May 13, 2020 10:16
-
-
Save lawreyios/59b415d39c1deb12317072ac05d673ef to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ModalView: View { | |
var body: some View { | |
NavigationView { | |
VStack { | |
Spacer() | |
Text("ModalView") | |
Spacer() | |
}.modifier(RedNavigationBar(title: "Modal")) | |
} | |
} | |
} | |
struct ContentView: View { | |
@State var presentedModal = false | |
var body: some View { | |
NavigationView { | |
VStack { | |
Spacer() | |
Spacer() | |
Text("ContentView") | |
Spacer() | |
Button(action: { | |
self.presentedModal = true | |
}) { | |
Text("Present Modal") | |
} | |
Spacer() | |
Spacer() | |
} | |
.modifier(GreenNavigationBar(title: "Content")) | |
.sheet(isPresented: $presentedModal) { | |
ModalView() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment