Created
May 10, 2020 06:41
-
-
Save donchan922/8253e5fd0e34f31d9a11973ec596ed37 to your computer and use it in GitHub Desktop.
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 { | |
@Environment(\.managedObjectContext) var context | |
@State private var isShowingModal = false | |
var body: some View { | |
Button(action: { | |
self.isShowingModal.toggle() | |
}) { | |
Text("go to SubView") | |
}.sheet(isPresented: $isShowingModal) { | |
SubView().environment(\.managedObjectContext, self.context) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment