Disappearing list

My WatchOS app uses two view controllers with a paged navigation from the first to the second. The first view contains a list. The second view presents a modal. When the modal is closed and I navigate back to the first view controller the list is not visible. The view controllers contains nothing but the body. What can I do to make the list always visible?


First view

struct ContentView: View {
    var body: some View {
        List {
            Text("Hello World")
            Text("Hello World again")
        }
    }
}



Second view

struct NextView: View {
    @State private var showModal = false
    var body: some View {
        Button(action: {
            self.showModal = true
        }) {
            Text("Button")
        }.sheet(isPresented: $showModal) {
            Text("Modal")
        }
    }
}

Replies

Can you include a little more of the UI code here? I don't for example see how you're navigating from ContentView to NextView—without seeing how that's happening I can't tell what might have gone wrong here.

The views are bodies of otherwise empty view controllers.


class HostingController: WKHostingController {
    override var body: ContentView {
        return ContentView()
    }
}
class NextController: WKHostingController<NextView> {
    override var body: NextView {
        return NextView()
    }
}


The controllers setup in the Interface.storyboard, and HostingController has relationship "next page" to NextController.


Interface.storyboard image

https://share.icloud.com/photos/0lNgRA95ZxSOLbVbCGKd1tfdQ