Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created December 31, 2020 18:45
Show Gist options
  • Save azamsharp/95fa4747700be59ea9ad7805c601a55b to your computer and use it in GitHub Desktop.
Save azamsharp/95fa4747700be59ea9ad7805c601a55b to your computer and use it in GitHub Desktop.
struct ViewA: View {
@State private var isActive: Bool = false
var body: some View {
VStack {
NavigationLink(
destination: ViewB(rootActive: $isActive),
isActive: $isActive,
label: {
Text("Go to View B")
})
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.green)
.edgesIgnoringSafeArea(.all)
.navigationTitle("View A")
.embedInNavigationView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment