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