ListCellType
@MainActor
public struct ListCellType : IntrospectableViewType
An abstract representation of a List
cell type in SwiftUI.
struct ContentView: View {
var body: some View {
List {
ForEach(1...3, id: \.self) { int in
Text("Item \(int)")
.introspect(.listCell, on: .iOS(.v15Earlier)) {
print(type(of: $0)) // UITableViewCell
}
.introspect(.listCell, on: .iOS(.v16Later)) {
print(type(of: $0)) // UICollectionViewCell
}
}
}
}
}
-
Declaration
Swift
@MainActor public var scope: IntrospectionScope { get }