Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Last active July 5, 2019 15:06
Show Gist options
  • Save Dimillian/b144d61ea7410ad2af44fdb8f2f65958 to your computer and use it in GitHub Desktop.
Save Dimillian/b144d61ea7410ad2af44fdb8f2f65958 to your computer and use it in GitHub Desktop.
import SwiftUI
import PlaygroundSupport
struct RootView: View {
var body: some View {
NavigationView {
MainView()
}
}
}
struct MainView: View {
var body: some View {
List {
NavigationLink(destination: SecondaryView()) {
Text("working")
}
ScrollView(.horizontal) {
HStack {
NavigationLink(destination: SecondaryView()) {
Text("Not working")
}
NavigationLink(destination: SecondaryView()) {
Text("Not working")
}
NavigationLink(destination: SecondaryView()) {
Text("Not working")
}
NavigationLink(destination: SecondaryView()) {
Text("Not working")
}
NavigationLink(destination: SecondaryView()) {
Text("Not working")
}
}
}
}
}
}
struct SecondaryView: View {
var body: some View {
Text("Hello world")
}
}
PlaygroundPage.current.liveView = UIHostingController(rootView: RootView())
PlaygroundPage.current.needsIndefiniteExecution = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment