swiftui Split View / Navigationlink

The following shows a master-detail type app and behaves normally on an iPad but, if I enter Split View somethind odd starts to happen, a [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy... debug message appears and tapping the navigation link causes the NextView to slide in three times, one on top of the other and then slides out to the right to reveal MasterView again.


Sometimes it happens when first entering Split View, other times when returning to fullscreen.


Has anybody got any thoughts on why? Thanks.


import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            MasterView()
            DetailView()
        }
    }
}

struct MasterView: View {
    var body: some View {
        Form {
            NavigationLink ("Go to next view", destination: NextView())
            .isDetailLink(false)
        }
    }
}

struct DetailView: View {
    var body: some View {
        Text("Detail View")
    }
}

struct NextView: View {
    var body: some View {
        Text("Next View")
    }
}

Replies

Update: I have found my problem. I had the top list as grouped and the second level as default. When I changed the top list to default it works.


I have the exact same problem and I can't get my head around why. I have also tried to remove the second view (for splitview). But I get the same problem after rotating the device to landscape and then back again.