Structures
The following structures are available globally.
- 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct SmartUpdater<T> where T : SmartDecodable, T : SmartEncodable 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct SmartIgnored<T> : PropertyWrapperableextension SmartIgnored: Codable - 
                  
                  
Undocumented
See moreDeclaration
 - 
                  
                  
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct SmartFlat<T> : PropertyWrapperable where T : Decodable, T : Encodableextension SmartFlat: Codable - 
                  
                  
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct SmartHexColor : PropertyWrapperableextension SmartHexColor: Codable - 
                  
                  
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct SmartPublished<Value> : PropertyWrapperable where Value : Decodable, Value : Encodableextension SmartPublished: Codable - 
                  
                  
Undocumented
See moreDeclaration
 
- 
                  
                  
Resolve the mapping relationship of keys
Declaration
Swift
public struct SmartKeyTransformer - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct SmartValueTransformer - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct FastTransformer<Object, JSON> : ValueTransformable - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct SmartDataTransformer : ValueTransformable - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct SmartDateTransformer : ValueTransformable - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct SmartURLTransformer : ValueTransformable - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct SmartHexColorTransformer : ValueTransformable 
- 
                  
                  
弹框样式可扩展枚举
See moreDeclaration
Swift
public struct AlertStyle : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
图片格式可扩展枚举
See moreDeclaration
Swift
public struct ImageFormat : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
网络图片加载选项,默认兼容SDWebImage
See moreDeclaration
Swift
public struct WebImageOptions : OptionSet, Sendable 
- 
                  
                  
图片选择插件过滤类型
See moreDeclaration
Swift
public struct ImagePickerFilterType : OptionSet, Sendable 
- 
                  
                  
消息吐司可扩展样式枚举
See moreDeclaration
Swift
public struct ToastStyle : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
进度条视图样式枚举,可扩展
See moreDeclaration
Swift
public struct ProgressViewStyle : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
指示器视图样式枚举,可扩展
See moreDeclaration
Swift
public struct IndicatorViewStyle : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
缓存类型枚举
See moreDeclaration
Swift
public struct CacheType : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
Declaration
Swift
@propertyWrapper public struct CachedValue<Value> 
- 
                  
                  
可扩展权限类型
See moreDeclaration
Swift
public struct AuthorizeType : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
本地图片解码编码选项,默认兼容SDWebImage
See moreDeclaration
Swift
public struct ImageCoderOptions : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
Declaration
Swift
@dynamicMemberLookup public struct JSON : @unchecked Sendableextension JSON: AnyModelextension JSON: Swift.Collectionextension JSON: Swift.ExpressibleByStringLiteralextension JSON: Swift.ExpressibleByIntegerLiteralextension JSON: Swift.ExpressibleByBooleanLiteralextension JSON: Swift.ExpressibleByFloatLiteralextension JSON: Swift.ExpressibleByDictionaryLiteralextension JSON: Swift.ExpressibleByArrayLiteralextension JSON: Swift.RawRepresentableextension JSON: Swift.CustomStringConvertible, Swift.CustomDebugStringConvertibleextension JSON: Swift.Comparableextension JSON: Codable 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct AnyCodingKey : CodingKey 
- 
                  
                  
模块可扩展优先级
See moreDeclaration
Swift
public struct ModulePriority : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
控制器导航选项定义
See moreDeclaration
Swift
public struct NavigatorOptions : OptionSet, Sendable 
- 
                  
                  
可扩展屏幕尺寸
See moreDeclaration
Swift
public struct ScreenInch : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
UserDefault存储属性包装器注解,兼容AnyArchivable协议,默认为手工指定或初始值
使用示例: @StoredValue(“userName”) static var userName: String = “”
See moreDeclaration
Swift
@propertyWrapper public struct StoredValue<Value> 
- 
                  
                  
模块属性包装器注解
使用示例: @ModuleValue(UserModuleService.self) static var userModule: UserModuleService
See moreDeclaration
Swift
@propertyWrapper public struct ModuleValue<Value> 
- 
                  
                  
插件属性包装器注解
使用示例: @PluginValue(TestPluginProtocol.self) static var testPlugin: TestPluginProtocol
See moreDeclaration
Swift
@propertyWrapper public struct PluginValue<Value> 
- 
                  
                  
导航栏可扩展全局样式
See moreDeclaration
Swift
public struct NavigationBarStyle : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
可扩展测试套件,默认automatic
See moreDeclaration
Swift
public struct TestSuite : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
可扩展主题模式(扩展值与样式值相同即可)
See moreDeclaration
Swift
public struct ThemeMode : RawRepresentable, Equatable, Hashable, Sendable 
- 
                  
                  
视图样式可扩展枚举
定义UIView通用default样式示例:
extension ViewStyle where Base: UIView { public static var `default`: Self { .init("default") } }自定义UITextField扩展custom样式示例:
See moreextension ViewStyle where Base: UITextField { public static var custom: Self { .init("custom") } }Declaration
Swift
public struct ViewStyle<Base> : RawRepresentable, Equatable, Hashable, Sendable where Base : UIView 
- 
                  
                  
规则验证器,可扩展
See moreDeclaration
Swift
public struct Validator<Value> : Sendable - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct DecodableEventSourceMessage<T> : @unchecked Sendable where T : Decodable - 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct EventSourceMessage : @unchecked Sendable - 
                  
                  
Undocumented
See moreDeclaration
Swift
@propertyWrapper @MainActor public struct SpeechRecognitionAuthStatus : DynamicProperty 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct RootRelativePath : Hashable, Sendable 
- 
                  
                  
Declaration
Swift
@propertyWrapper @MainActor public struct CloudStorage<Value> : DynamicPropertyextension CloudStorage: Sendable where Value: Sendable 
- 
                  
                  
Declaration
Swift
@propertyWrapper public struct MMAPValue<Value> - 
                  
                  
导航栏配置,兼容AnyView和UIKit对象
See moreDeclaration
Swift
@MainActor public struct NavigationBarConfiguration 
- 
                  
                  
SwiftUI状态视图
\@State: 内部值传递,赋值时会触发View刷新 \@Binding: 外部引用传递,实现向外传递引用 \@ObservableObject: 可被订阅的对象,属性标记@Published时生效 \@ObservedObject: View订阅监听,收到通知时刷新View,不被View持有,随时可能被销毁,适合外部数据 \@EnvironmentObject: 全局环境对象,使用environmentObject方法绑定,View及其子层级可直接读取 \@StateObject: View引用对象,生命周期和View保持一致,刷新时数据会保持直到View被销毁
See moreDeclaration
Swift
@MainActor public struct StateView<Object> : View 
- 
                  
                  
不可见视图,当某个场景EmptyView不生效时可使用InvisibleView替代,比如EmptyView不触发onAppear
See moreDeclaration
Swift
@MainActor public struct InvisibleView : View 
- 
                  
                  
Declaration
Swift
@MainActor public struct WaterfallGrid<Data, ID, Content> : View where Data : RandomAccessCollection, ID : Hashable, Content : View 
- 
                  
                  
图片视图,支持网络图片和动图
See moreDeclaration
Swift
@MainActor public struct ImageView : UIViewRepresentable 
- 
                  
                  
加载插件视图包装器
See moreDeclaration
Swift
@MainActor public struct LoadingPluginView : UIViewRepresentable 
- 
                  
                  
进度插件视图包装器
See moreDeclaration
Swift
@MainActor public struct ProgressPluginView : UIViewRepresentable 
- 
                  
                  
The scope of introspection i.e. where introspect should look to find the desired target view relative to the applied
See more.introspect(...)modifier.Declaration
Swift
public struct IntrospectionScope : OptionSet, Sendable 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
@_spi(FW) @MainActor public struct IntrospectionSelector<Target> where Target : PlatformEntity 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct iOSVersion : PlatformVersion 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
@MainActor public struct PlatformViewVersionPredicate<SwiftUIViewType, PlatformSpecificEntity> where SwiftUIViewType : IntrospectableViewType, PlatformSpecificEntity : PlatformEntity 
- 
                  
                  
An abstract representation of a generic SwiftUI view type.
struct ContentView: View { var body: some View { HStack { Image(systemName: "scribble") Text("Some text") } .introspect(.view, on: .iOS(.all)) { print(type(of: $0)) // some subclass of UIView } } }Declaration
Swift
@MainActor public struct ViewType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
ColorPickertype in SwiftUI.struct ContentView: View { @State var color = Color.red var body: some View { ColorPicker("Pick a color", selection: $color) .introspect(.colorPicker, on: .iOS(.v14Later)) { print(type(of: $0)) // UIColorPicker } } }Declaration
Swift
@MainActor public struct ColorPickerType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
DatePickertype in SwiftUI.struct ContentView: View { @State var date = Date() var body: some View { DatePicker("Pick a date", selection: $date) .introspect(.datePicker, on: .iOS(.all)) { print(type(of: $0)) // UIDatePicker } } }Declaration
Swift
@MainActor public struct DatePickerType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
DatePickertype in SwiftUI, with.compactstyle.
See morestruct ContentView: View { @State var date = Date() var body: some View { DatePicker("Pick a date", selection: $date) .datePickerStyle(.compact) .introspect(.datePicker(style: .compact), on: .iOS(.v14Later)) { print(type(of: $0)) // UIDatePicker } } }Declaration
Swift
@MainActor public struct DatePickerWithCompactStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
DatePickertype in SwiftUI, with.graphicalstyle.
See morestruct ContentView: View { @State var date = Date() var body: some View { DatePicker("Pick a date", selection: $date) .datePickerStyle(.graphical) .introspect(.datePicker(style: .graphical), on: .iOS(.v14Later)) { print(type(of: $0)) // UIDatePicker } } }Declaration
Swift
@MainActor public struct DatePickerWithGraphicalStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
DatePickertype in SwiftUI, with.wheelstyle.
See morestruct ContentView: View { @State var date = Date() var body: some View { DatePicker("Pick a date", selection: $date) .datePickerStyle(.wheel) .introspect(.datePicker(style: .wheel), on: .iOS(.all)) { print(type(of: $0)) // UIDatePicker } } }Declaration
Swift
@MainActor public struct DatePickerWithWheelStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Formtype in SwiftUI.struct ContentView: View { var body: some View { Form { Text("Item 1") Text("Item 2") Text("Item 3") } .introspect(.form, on: .iOS(.v15Earlier)) { print(type(of: $0)) // UITableView } .introspect(.form, on: .iOS(.v16Later)) { print(type(of: $0)) // UICollectionView } } }Declaration
Swift
@MainActor public struct FormType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Formtype in SwiftUI, with.groupedstyle.
See morestruct ContentView: View { var body: some View { Form { Text("Item 1") Text("Item 2") Text("Item 3") } .formStyle(.grouped) .introspect(.form(style: .grouped), on: .iOS(.v16Later)) { print(type(of: $0)) // UITableView } } }Declaration
Swift
@MainActor public struct FormWithGroupedStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of
.fullScreenCoverin SwiftUI.
See morepublic struct ContentView: View { @State var isPresented = false public var body: some View { Button("Present", action: { isPresented = true }) .fullScreenCover(isPresented: $isPresented) { Button("Dismiss", action: { isPresented = false }) .introspect(.fullScreenCover, on: .iOS(.v14Later)) { print(type(of: $0)) // UIPresentationController } } } }Declaration
Swift
@MainActor public struct FullScreenCoverType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Listtype in SwiftUI.
See morestruct 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 } } }Declaration
Swift
@MainActor public struct ListType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Listtype in SwiftUI, with.groupedstyle.
See morestruct 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 } } }Declaration
Swift
@MainActor public struct ListWithGroupedStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Listtype in SwiftUI, with.insetGroupedstyle.
See morestruct ContentView: View { var body: some View { List { Text("Item 1") Text("Item 2") Text("Item 3") } .listStyle(.insetGrouped) .introspect(.list(style: .insetGrouped), on: .iOS(.v15Earlier14)) { print(type(of: $0)) // UITableView } .introspect(.list(style: .insetGrouped), on: .iOS(.v16Later)) { print(type(of: $0)) // UICollectionView } } }Declaration
Swift
@MainActor public struct ListWithInsetGroupedStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Listtype in SwiftUI, with.insetstyle.
See morestruct ContentView: View { var body: some View { List { Text("Item 1") Text("Item 2") Text("Item 3") } .listStyle(.inset) .introspect(.list(style: .inset), on: .iOS(.v15Earlier14)) { print(type(of: $0)) // UITableView } .introspect(.list(style: .inset), on: .iOS(.v16Later)) { print(type(of: $0)) // UICollectionView } } }Declaration
Swift
@MainActor public struct ListWithInsetStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Listtype in SwiftUI, with.sidebarstyle.
See morestruct 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 } } }Declaration
Swift
@MainActor public struct ListWithSidebarStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of a
Listcell type in SwiftUI.
See morestruct 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 struct ListCellType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
NavigationSplitViewtype in SwiftUI.struct ContentView: View { var body: some View { NavigationSplitView { Text("Root") } detail: { Text("Detail") } .introspect(.navigationSplitView, on: .iOS(.v16Later)) { print(type(of: $0)) // UISplitViewController } } }Declaration
Swift
@MainActor public struct NavigationSplitViewType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
NavigationStacktype in SwiftUI.struct ContentView: View { var body: some View { NavigationStack { Text("Root") } .introspect(.navigationStack, on: .iOS(.v16Later)) { print(type(of: $0)) // UINavigationController } } }Declaration
Swift
@MainActor public struct NavigationStackType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
NavigationViewtype in SwiftUI, with.columnsstyle.
See morestruct ContentView: View { var body: some View { NavigationView { Text("Root") } .navigationViewStyle(DoubleColumnNavigationViewStyle()) .introspect(.navigationView(style: .columns), on: .iOS(.all)) { print(type(of: $0)) // UISplitViewController } } }Declaration
Swift
@MainActor public struct NavigationViewWithColumnsStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
NavigationViewtype in SwiftUI, with.stackstyle.
See morestruct ContentView: View { var body: some View { NavigationView { Text("Root") } .navigationViewStyle(.stack) .introspect(.navigationView(style: .stack), on: .iOS(.all)) { print(type(of: $0)) // UINavigationController } } }Declaration
Swift
@MainActor public struct NavigationViewWithStackStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the page control type in SwiftUI.
struct ContentView: View { var body: some View { TabView { Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) } .tabViewStyle(.page(indexDisplayMode: .always)) .introspect(.pageControl, on: .iOS(.v14Later)) { print(type(of: $0)) // UIPageControl } } }Declaration
Swift
@MainActor public struct PageControlType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Pickertype in SwiftUI, with.segmentedstyle.
See morestruct ContentView: View { @State var selection = "1" var body: some View { Picker("Pick a number", selection: $selection) { Text("1").tag("1") Text("2").tag("2") Text("3").tag("3") } .pickerStyle(.segmented) .introspect(.picker(style: .segmented), on: .iOS(.all)) { print(type(of: $0)) // UISegmentedControl } } }Declaration
Swift
@MainActor public struct PickerWithSegmentedStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Pickertype in SwiftUI, with.wheelstyle.
See morestruct ContentView: View { @State var selection = "1" var body: some View { Picker("Pick a number", selection: $selection) { Text("1").tag("1") Text("2").tag("2") Text("3").tag("3") } .pickerStyle(.wheel) .introspect(.picker(style: .wheel), on: .iOS(.all)) { print(type(of: $0)) // UIPickerView } } }Declaration
Swift
@MainActor public struct PickerWithWheelStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of
.popoverin SwiftUI.
See morepublic struct ContentView: View { @State var isPresented = false public var body: some View { Button("Present", action: { isPresented = true }) .popover(isPresented: $isPresented) { Button("Dismiss", action: { isPresented = false }) .introspect(.popover, on: .iOS(.all)) { print(type(of: $0)) // UIPopoverPresentationController } } } }Declaration
Swift
@MainActor public struct PopoverType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
ProgressViewtype in SwiftUI, with.circularstyle.
See morestruct ContentView: View { var body: some View { ProgressView(value: 0.5) .progressViewStyle(.circular) .introspect(.progressView(style: .circular), on: .iOS(.v14Later)) { print(type(of: $0)) // UIActivityIndicatorView } } }Declaration
Swift
@MainActor public struct ProgressViewWithCircularStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
ProgressViewtype in SwiftUI, with.linearstyle.
See morestruct ContentView: View { var body: some View { ProgressView(value: 0.5) .progressViewStyle(.linear) .introspect(.progressView(style: .linear), on: .iOS(.v14Later)) { print(type(of: $0)) // UIProgressView } } }Declaration
Swift
@MainActor public struct ProgressViewWithLinearStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
ScrollViewtype in SwiftUI.struct ContentView: View { var body: some View { ScrollView { Text("Item") } .introspect(.scrollView, on: .iOS(.all)) { print(type(of: $0)) // UIScrollView } } }Declaration
Swift
@MainActor public struct ScrollViewType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the search field displayed via the
.searchablemodifier in SwiftUI.struct ContentView: View { @State var searchTerm = "" var body: some View { NavigationView { Text("Root") .searchable(text: $searchTerm) } .navigationViewStyle(.stack) .introspect(.searchField, on: .iOS(.v15Later)) { print(type(of: $0)) // UISearchBar } } }Declaration
Swift
@MainActor public struct SearchFieldType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
SecureFieldtype in SwiftUI.struct ContentView: View { @State var text = "Lorem ipsum" var body: some View { SecureField("Secure Field", text: $text) .introspect(.secureField, on: .iOS(.all)) { print(type(of: $0)) // UISecureField } } }Declaration
Swift
@MainActor public struct SecureFieldType : IntrospectableViewType 
- 
                  
                  
An abstract representation of
.sheetin SwiftUI.
See morepublic struct ContentView: View { @State var isPresented = false public var body: some View { Button("Present", action: { isPresented = true }) .sheet(isPresented: $isPresented) { Button("Dismiss", action: { isPresented = false }) .introspect(.sheet, on: .iOS(.all)) { print(type(of: $0)) // UIPresentationController } } } }Declaration
Swift
@MainActor public struct SheetType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Slidertype in SwiftUI.struct ContentView: View { @State var selection = 0.5 var body: some View { Slider(value: $selection, in: 0...1) .introspect(.slider, on: .iOS(.all)) { print(type(of: $0)) // UISlider } } }Declaration
Swift
@MainActor public struct SliderType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Steppertype in SwiftUI.iOS
struct ContentView: View { @State var selection = 5 var body: some View { Stepper("Select a number", value: $selection, in: 0...10) .introspect(.stepper, on: .iOS(.all)) { print(type(of: $0)) // UIStepper } } }Declaration
Swift
@MainActor public struct StepperType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Tabletype in SwiftUI, with any style.struct ContentView: View { struct Purchase: Identifiable { let id = UUID() let price: Decimal } var body: some View { Table(of: Purchase.self) { TableColumn("Base price") { purchase in Text(purchase.price, format: .currency(code: "USD")) } TableColumn("With 15% tip") { purchase in Text(purchase.price * 1.15, format: .currency(code: "USD")) } TableColumn("With 20% tip") { purchase in Text(purchase.price * 1.2, format: .currency(code: "USD")) } } rows: { TableRow(Purchase(price: 20)) TableRow(Purchase(price: 50)) TableRow(Purchase(price: 75)) } .introspect(.table, on: .iOS(.v16Later)) { print(type(of: $0)) // UICollectionView } } }Declaration
Swift
@MainActor public struct TableType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
TabViewtype in SwiftUI.struct ContentView: View { var body: some View { TabView { Text("Tab 1").tabItem { Text("Tab 1") } Text("Tab 2").tabItem { Text("Tab 2") } } .introspect(.tabView, on: .iOS(.all)) { print(type(of: $0)) // UITabBarController } } }Declaration
Swift
@MainActor public struct TabViewType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
TabViewtype in SwiftUI, with.pagestyle.
See morestruct ContentView: View { var body: some View { TabView { Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) } .tabViewStyle(.page(indexDisplayMode: .always)) .introspect(.tabView(style: .page), on: .iOS(.v14Later)) { print(type(of: $0)) // UICollectionView } } }Declaration
Swift
@MainActor public struct TabViewWithPageStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
TextEditortype in SwiftUI.struct ContentView: View { @State var text = "Lorem ipsum" var body: some View { TextEditor(text: $text) .introspect(.textEditor, on: .iOS(.v14Later)) { print(type(of: $0)) // UITextView } } }Declaration
Swift
@MainActor public struct TextEditorType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
TextFieldtype in SwiftUI.struct ContentView: View { @State var text = "Lorem ipsum" var body: some View { TextField("Text Field", text: $text) .introspect(.textField, on: .iOS(.all)) { print(type(of: $0)) // UITextField } } }Declaration
Swift
@MainActor public struct TextFieldType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
TextFieldtype in SwiftUI, with.verticalaxis.
See morestruct ContentView: View { @State var text = "Lorem ipsum" var body: some View { TextField("Text Field", text: $text, axis: .vertical) .introspect(.textField(axis: .vertical), on: .iOS(.v16Later)) { print(type(of: $0)) // UITextView } } }Declaration
Swift
@MainActor public struct TextFieldWithVerticalAxisType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Toggletype in SwiftUI.struct ContentView: View { @State var isOn = false var body: some View { Toggle("Toggle", isOn: $isOn) .introspect(.toggle, on: .iOS(.all)) { print(type(of: $0)) // UISwitch } } }Declaration
Swift
@MainActor public struct ToggleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of the
Toggletype in SwiftUI, with.switchstyle.
See morestruct ContentView: View { @State var isOn = false var body: some View { Toggle("Switch", isOn: $isOn) .toggleStyle(.switch) .introspect(.toggle(style: .switch), on: .iOS(.all)) { print(type(of: $0)) // UISwitch } } }Declaration
Swift
@MainActor public struct ToggleWithSwitchStyleType : IntrospectableViewType 
- 
                  
                  
An abstract representation of a view’s window in SwiftUI.
struct ContentView: View { var body: some View { Text("Content") .introspect(.window, on: .iOS(.all)) { print(type(of: $0)) // UIWindow } } }Declaration
Swift
@MainActor public struct WindowType : IntrospectableViewType - 
                  
                  
An abstract representation of the receiving SwiftUI view’s view controller, or the closest ancestor view controller if missing.
See morestruct ContentView: View { var body: some View { NavigationView { Text("Root").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) .introspect(.viewController, on: .iOS(.all)) { print(type(of: $0)) // some subclass of UIHostingController } } .navigationViewStyle(.stack) .introspect(.viewController, on: .iOS(.all)) { print(type(of: $0)) // UINavigationController } } }Declaration
Swift
@MainActor public struct ViewControllerType : IntrospectableViewType 
- 
                  
                  
线条形状,用于分割线、虚线等。自定义路径形状:Path { (path) in … } 常用分割线:Rectangle.foregroundColor替代Divider组件
See moreDeclaration
Swift
public struct LineShape : Shape - 
                  
                  
不规则圆角形状
See moreDeclaration
Swift
public struct RoundedCornerShape : Shape - 
                  
                  
视图移除性修改器
See moreDeclaration
Swift
@MainActor public struct RemovableModifier : ViewModifier 
- 
                  
                  
透明度按钮样式,支持设置高亮和禁用时的透明度
See moreDeclaration
Swift
@MainActor public struct OpacityButtonStyle : ButtonStyle 
- 
                  
                  
通用UIView包装器
See moreDeclaration
Swift
@MainActor public struct ViewWrapper<T> : UIViewRepresentable where T : UIView 
- 
                  
                  
自定义指示器视图动画类型枚举,可扩展
See moreDeclaration
Swift
public struct IndicatorViewAnimationType : RawRepresentable, Equatable, Hashable, Sendable - 
                  
                  
A handler for verifying outgoing requests.
See moreDeclaration
Swift
public struct NetworkMockOnRequestHandler - 
                  
                  
Can be used for registering Mocked data, returned by the
See moreMockingURLProtocol.Declaration
Swift
public struct NetworkMocker - 
                  
                  
A Mock which can be used for mocking data requests with the
See moreMockerby callingMocker.register(...).Declaration
Swift
public struct NetworkMock : Equatable, @unchecked Sendable 
- 
                  
                  
Undocumented
See moreDeclaration
Swift
public struct WebSocketError : Error 
- 
                  
                  
Undocumented
Declaration
Swift
public struct WebSocketFrame 
- 
                  
                  
Undocumented
Declaration
Swift
public struct WebSocketURLParts 
View on GitHub
        Structures  Reference