Hide separators in List (SwiftUI)

How do I hide the separation lines inside Lists in SwiftUI for iOS 14?
Previously I could use
Code Block
UITableView.appearance().separatorStyle = .none

but this doesn't seem to work anymore.

This is how I do it. Just match UITableView.appearance().separatorColor and listRowBackground.

struct ContentView: View {
    init(){
        UITableView.appearance().separatorColor = UIColor.white
    }

    struct RowImage: View {
        var id: Int
        var body: some View {
            VStack{
                Text("TEST\(id)")
            }
        }
    }

    var body: some View {
        List (0 ..< 100,id:\.self) { i in
            RowImage(id: i)
                .listRowBackground(Color.white)
        }
}

Just for completion:

This is working for iOS 16 and Xcode 14.3

.listRowSeparator(.hidden)

You need to set it on each row. e.g.:

List(0..<5) { _ in
    PreferenceView()
        .listRowSeparator(.hidden)
 }
Hide separators in List (SwiftUI)
 
 
Q