Last active
June 21, 2020 08:11
-
-
Save gahntpo/f4d0bfcc02cc7f1beca89988e1e14a14 to your computer and use it in GitHub Desktop.
using NavigationController to switch between tabs
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
import SwiftUI | |
struct FirstDetailView: View { | |
@EnvironmentObject var nav: NavigationController | |
var body: some View { | |
VStack { | |
Text("show me the details") | |
Button(action: { | |
self.nav.selection = 1 | |
}) { | |
Text("get me to second section") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment