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