Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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