ListWithGroupedStyleType
@MainActor
public struct ListWithGroupedStyleType : IntrospectableViewType
An abstract representation of the List
type in SwiftUI, with .grouped
style.
struct ContentView: View {
var body: some View {
List {
Text("Item 1")
Text("Item 2")
Text("Item 3")
}
.listStyle(.grouped)
.introspect(.list(style: .grouped), on: .iOS(.v15Earlier)) {
print(type(of: $0)) // UITableView
}
.introspect(.list(style: .grouped), on: .iOS(.v16Later)) {
print(type(of: $0)) // UICollectionView
}
}
}