Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created March 5, 2022 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/aad4e73fcf3f5257ada4dd9e366497bf to your computer and use it in GitHub Desktop.
Save laevandus/aad4e73fcf3f5257ada4dd9e366497bf to your computer and use it in GitHub Desktop.
final class FlowCoordinator: ObservableObject {}
let swiftUIView = ContentView()
.environmentObject(self) // self is FlowCoordinator
struct ContentView: View {
@EnvironmentObject var flowController: FlowCoordinator
var body: some View {
VStack(spacing: 8) {
Text("Root view")
Button("Present Sheet", action: flowController.showDetailView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment