Structures

The following structures are available globally.

Logger

  • 日志类型枚举

    See more

    Declaration

    Swift

    public struct LogType : OptionSet
  • 日志级别定义

    See more

    Declaration

    Swift

    public struct LogLevel : RawRepresentable, Equatable, Hashable

ModulePriority

  • 模块可扩展优先级

    See more

    Declaration

    Swift

    public struct ModulePriority : RawRepresentable, Equatable, Hashable

NavigatorOptions

NavigationStyle

  • 导航栏可扩展全局样式

    See more

    Declaration

    Swift

    public struct NavigationBarStyle : RawRepresentable, Equatable, Hashable

JSON

  • JSON

    See more

    Declaration

    Swift

    @dynamicMemberLookup
    public struct JSON
    extension JSON: AnyModel
    extension JSON: Swift.Collection
    extension JSON: Swift.ExpressibleByStringLiteral
    extension JSON: Swift.ExpressibleByIntegerLiteral
    extension JSON: Swift.ExpressibleByBooleanLiteral
    extension JSON: Swift.ExpressibleByFloatLiteral
    extension JSON: Swift.ExpressibleByDictionaryLiteral
    extension JSON: Swift.ExpressibleByArrayLiteral
    extension JSON: Swift.RawRepresentable
    extension JSON: Swift.CustomStringConvertible, Swift.CustomDebugStringConvertible
    extension JSON: Swift.Comparable
    extension JSON: Codable

Configuration

AlertPlugin

  • 弹框样式可扩展枚举

    See more

    Declaration

    Swift

    public struct AlertStyle : RawRepresentable, Equatable, Hashable

ImagePlugin

  • 本地图片解码编码选项,默认兼容SDWebImage

    See more

    Declaration

    Swift

    public struct ImageCoderOptions : RawRepresentable, Equatable, Hashable
  • 网络图片加载选项,默认兼容SDWebImage

    See more

    Declaration

    Swift

    public struct WebImageOptions : OptionSet

ImagePickerPlugin

ToastPlugin

  • 消息吐司可扩展样式枚举

    See more

    Declaration

    Swift

    public struct ToastStyle : RawRepresentable, Equatable, Hashable

IndicatorViewAnimation

  • 自定义指示器视图动画类型枚举,可扩展

    See more

    Declaration

    Swift

    public struct IndicatorViewAnimationType : RawRepresentable, Equatable, Hashable

ProgressViewPlugin

  • 进度条视图样式枚举,可扩展

    See more

    Declaration

    Swift

    public struct ProgressViewStyle : RawRepresentable, Equatable, Hashable

IndicatorViewPlugin

  • 指示器视图样式枚举,可扩展

    See more

    Declaration

    Swift

    public struct IndicatorViewStyle : RawRepresentable, Equatable, Hashable

AuthorizeType

  • 可扩展权限类型

    See more

    Declaration

    Swift

    public struct AuthorizeType : RawRepresentable, Equatable, Hashable

ThemeManager

  • 可扩展主题模式(扩展值与样式值相同即可)

    See more

    Declaration

    Swift

    public struct ThemeMode : RawRepresentable, Equatable, Hashable

Validator

  • 规则验证器,可扩展

    See more

    Declaration

    Swift

    public struct Validator<Value>
  • 缓存类型枚举

    See more

    Declaration

    Swift

    public struct CacheType : RawRepresentable, Equatable, Hashable

AnyCodingKey

ImageFormat

  • 图片格式可扩展枚举

    See more

    Declaration

    Swift

    public struct ImageFormat : RawRepresentable, Equatable, Hashable
  • A handler for verifying outgoing requests.

    See more

    Declaration

    Swift

    public struct NetworkMockOnRequestHandler
  • Can be used for registering Mocked data, returned by the MockingURLProtocol.

    See more

    Declaration

    Swift

    public struct NetworkMocker
  • A Mock which can be used for mocking data requests with the Mocker by calling Mocker.register(...).

    See more

    Declaration

    Swift

    public struct NetworkMock : Equatable

WebSocket

Framer

UIScreen+Adaptive

  • 可扩展屏幕尺寸

    See more

    Declaration

    Swift

    public struct ScreenInch : RawRepresentable, Equatable, Hashable

StoredValue

  • UserDefault存储属性包装器注解,默认为手工指定或初始值

    使用示例: @StoredValue(“userName”) static var userName: String = “”

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct StoredValue<T>

CachedValue

  • 缓存属性包装器注解,默认为手工指定或初始值

    使用示例: @CachedValue(“cacheKey”) static var cacheValue: String = “”

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct CachedValue<T>

ValidatedValue

  • ValidatedValue属性包装器注解,默认为手工指定或初始值

    使用示例: @ValidatedValue(.isEmail) var email: String = “”

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct ValidatedValue<T>

ModuleValue

  • 模块属性包装器注解

    使用示例: @ModuleValue(UserModuleService.self) static var userModule: UserModuleService

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct ModuleValue<T>

PluginValue

  • 插件属性包装器注解

    使用示例: @PluginValue(TestPluginProtocol.self) static var testPlugin: TestPluginProtocol

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct PluginValue<T>

RouterValue

  • 路由属性包装器注解

    使用示例: @RouterValue(AppRouter.pluginRouter(_:)) static var pluginUrl: String = “app://plugin/:id”

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct RouterValue
  • 导航栏配置,兼容AnyView和UIKit对象

    See more

    Declaration

    Swift

    public struct NavigationBarConfiguration

StateView

  • SwiftUI状态视图

    See more

    Declaration

    Swift

    public struct StateView : View

InvisibleView

  • 不可见视图,当某个场景EmptyView不生效时可使用InvisibleView替代,比如EmptyView不触发onAppear

    See more

    Declaration

    Swift

    public struct InvisibleView : View

Introspect

  • The scope of introspection i.e. where introspect should look to find the desired target view relative to the applied .introspect(...) modifier.

    SwiftUI-Introspect

    See more

    Declaration

    Swift

    public struct IntrospectionScope : OptionSet

IntrospectionSelector

PlatformVersion

PlatformViewVersion

ViewTypes

  • 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

    public struct ViewType : IntrospectableViewType

ColorPicker

  • An abstract representation of the ColorPicker type in SwiftUI.

    struct ContentView: View {
        @State var color = Color.red
    
        var body: some View {
            ColorPicker("Pick a color", selection: $color)
                .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UIColorPicker
                }
        }
    }
    

    Declaration

    Swift

    public struct ColorPickerType : IntrospectableViewType

DatePicker

  • An abstract representation of the DatePicker type 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

    public struct DatePickerType : IntrospectableViewType

DatePickerWithCompactStyle

  • An abstract representation of the DatePicker type in SwiftUI, with .compact style.

    struct ContentView: View {
        @State var date = Date()
    
        var body: some View {
            DatePicker("Pick a date", selection: $date)
                .datePickerStyle(.compact)
                .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UIDatePicker
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct DatePickerWithCompactStyleType : IntrospectableViewType

DatePickerWithGraphicalStyle

  • An abstract representation of the DatePicker type in SwiftUI, with .graphical style.

    struct ContentView: View {
        @State var date = Date()
    
        var body: some View {
            DatePicker("Pick a date", selection: $date)
                .datePickerStyle(.graphical)
                .introspect(.datePicker(style: .graphical), on: .iOS(.v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UIDatePicker
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct DatePickerWithGraphicalStyleType : IntrospectableViewType

DatePickerWithWheelStyle

  • An abstract representation of the DatePicker type in SwiftUI, with .wheel style.

    struct 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
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct DatePickerWithWheelStyleType : IntrospectableViewType

Form

  • An abstract representation of the Form type in SwiftUI.

    struct ContentView: View {
        var body: some View {
            Form {
                Text("Item 1")
                Text("Item 2")
                Text("Item 3")
            }
            .introspect(.form, on: .iOS(.v13, .v14, .v15)) {
                print(type(of: $0)) // UITableView
            }
            .introspect(.form, on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    

    Declaration

    Swift

    public struct FormType : IntrospectableViewType

FormWithGroupedStyle

  • An abstract representation of the Form type in SwiftUI, with .grouped style.

    struct ContentView: View {
        var body: some View {
            Form {
                Text("Item 1")
                Text("Item 2")
                Text("Item 3")
            }
            .formStyle(.grouped)
            .introspect(.form(style: .grouped), on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UITableView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct FormWithGroupedStyleType : IntrospectableViewType

FullScreenCover

  • An abstract representation of .fullScreenCover in SwiftUI.

    public 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(.v14, .v15, .v16, .v17)) {
                            print(type(of: $0)) // UIPresentationController
                        }
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct FullScreenCoverType : IntrospectableViewType

List

  • 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(.v13, .v14, .v15)) {
                print(type(of: $0)) // UITableView
            }
            .introspect(.list, on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ListType : IntrospectableViewType

ListWithGroupedStyle

  • 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(.v13, .v14, .v15)) {
                print(type(of: $0)) // UITableView
            }
            .introspect(.list(style: .grouped), on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ListWithGroupedStyleType : IntrospectableViewType

ListWithInsetGroupedStyleType

  • An abstract representation of the List type in SwiftUI, with .insetGrouped style.

    struct ContentView: View {
        var body: some View {
            List {
                Text("Item 1")
                Text("Item 2")
                Text("Item 3")
            }
            .listStyle(.insetGrouped)
            .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15)) {
                print(type(of: $0)) // UITableView
            }
            .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ListWithInsetGroupedStyleType : IntrospectableViewType

ListWithInsetStyle

  • An abstract representation of the List type in SwiftUI, with .inset style.

    struct ContentView: View {
        var body: some View {
            List {
                Text("Item 1")
                Text("Item 2")
                Text("Item 3")
            }
            .listStyle(.inset)
            .introspect(.list(style: .inset), on: .iOS(.v14, .v15)) {
                print(type(of: $0)) // UITableView
            }
            .introspect(.list(style: .inset), on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ListWithInsetStyleType : IntrospectableViewType

ListWithSidebarStyle

  • 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(.v14, .v15)) {
                print(type(of: $0)) // UITableView
            }
            .introspect(.list(style: .sidebar), on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ListWithSidebarStyleType : IntrospectableViewType

ListCell

  • 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(.v13, .v14, .v15)) {
                            print(type(of: $0)) // UITableViewCell
                        }
                        .introspect(.listCell, on: .iOS(.v16, .v17)) {
                            print(type(of: $0)) // UICollectionViewCell
                        }
                }
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ListCellType : IntrospectableViewType

NavigationSplitView

  • An abstract representation of the NavigationSplitView type in SwiftUI.

    struct ContentView: View {
        var body: some View {
            NavigationSplitView {
                Text("Root")
            } detail: {
                Text("Detail")
            }
            .introspect(.navigationSplitView, on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UISplitViewController
            }
        }
    }
    

    Declaration

    Swift

    public struct NavigationSplitViewType : IntrospectableViewType

NavigationStack

  • An abstract representation of the NavigationStack type in SwiftUI.

    struct ContentView: View {
        var body: some View {
            NavigationStack {
                Text("Root")
            }
            .introspect(.navigationStack, on: .iOS(.v16, .v17)) {
                print(type(of: $0)) // UINavigationController
            }
        }
    }
    

    Declaration

    Swift

    public struct NavigationStackType : IntrospectableViewType

NavigationViewWithColumnsStyle

  • An abstract representation of the NavigationView type in SwiftUI, with .columns style.

    struct ContentView: View {
        var body: some View {
            NavigationView {
                Text("Root")
            }
            .navigationViewStyle(DoubleColumnNavigationViewStyle())
            .introspect(.navigationView(style: .columns), on: .iOS(.all)) {
                print(type(of: $0)) // UISplitViewController
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct NavigationViewWithColumnsStyleType : IntrospectableViewType

NavigationViewWithStackStyle

  • An abstract representation of the NavigationView type in SwiftUI, with .stack style.

    struct ContentView: View {
        var body: some View {
            NavigationView {
                Text("Root")
            }
            .navigationViewStyle(.stack)
            .introspect(.navigationView(style: .stack), on: .iOS(.all)) {
                print(type(of: $0)) // UINavigationController
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct NavigationViewWithStackStyleType : IntrospectableViewType

PageControl

  • 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(.v14, .v15, .v16, .v17)) {
                print(type(of: $0)) // UIPageControl
            }
        }
    }
    

    Declaration

    Swift

    public struct PageControlType : IntrospectableViewType

PickerWithSegmentedStyle

  • An abstract representation of the Picker type in SwiftUI, with .segmented style.

    struct 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
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct PickerWithSegmentedStyleType : IntrospectableViewType

PickerWithWheelStyle

  • An abstract representation of the Picker type in SwiftUI, with .wheel style.

    struct 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
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct PickerWithWheelStyleType : IntrospectableViewType

Popover

  • An abstract representation of .popover in SwiftUI.

    public 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
                        }
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct PopoverType : IntrospectableViewType

ProgressViewWithCircularStyle

  • An abstract representation of the ProgressView type in SwiftUI, with .circular style.

    struct ContentView: View {
        var body: some View {
            ProgressView(value: 0.5)
                .progressViewStyle(.circular)
                .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UIActivityIndicatorView
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ProgressViewWithCircularStyleType : IntrospectableViewType

ProgressViewWithLinearStyle

  • An abstract representation of the ProgressView type in SwiftUI, with .linear style.

    struct ContentView: View {
        var body: some View {
            ProgressView(value: 0.5)
                .progressViewStyle(.linear)
                .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UIProgressView
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ProgressViewWithLinearStyleType : IntrospectableViewType

ScrollView

  • An abstract representation of the ScrollView type in SwiftUI.

    struct ContentView: View {
        var body: some View {
            ScrollView {
                Text("Item")
            }
            .introspect(.scrollView, on: .iOS(.all)) {
                print(type(of: $0)) // UIScrollView
            }
        }
    }
    

    Declaration

    Swift

    public struct ScrollViewType : IntrospectableViewType

SearchField

  • An abstract representation of the search field displayed via the .searchable modifier in SwiftUI.

    struct ContentView: View {
        @State var searchTerm = ""
    
        var body: some View {
            NavigationView {
                Text("Root")
                    .searchable(text: $searchTerm)
            }
            .navigationViewStyle(.stack)
            .introspect(.searchField, on: .iOS(.v15, .v16, .v17)) {
                print(type(of: $0)) // UISearchBar
            }
        }
    }
    

    Declaration

    Swift

    public struct SearchFieldType : IntrospectableViewType

SecureField

  • An abstract representation of the SecureField type in SwiftUI.

    struct ContentView: View {
        @State var text = "Lorem ipsum"
    
        var body: some View {
            SecureField("Secure Field", text: $text)
                .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UISecureField
                }
        }
    }
    

    Declaration

    Swift

    public struct SecureFieldType : IntrospectableViewType

Sheet

  • An abstract representation of .sheet in SwiftUI.

    public 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
                        }
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct SheetType : IntrospectableViewType

Slider

  • An abstract representation of the Slider type 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

    public struct SliderType : IntrospectableViewType

Stepper

  • An abstract representation of the Stepper type 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

    public struct StepperType : IntrospectableViewType

Table

  • An abstract representation of the Table type 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(.v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    

    Declaration

    Swift

    public struct TableType : IntrospectableViewType

TabView

  • An abstract representation of the TabView type 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

    public struct TabViewType : IntrospectableViewType

TabViewWithPageStyle

  • An abstract representation of the TabView type in SwiftUI, with .page style.

    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(.tabView(style: .page), on: .iOS(.v14, .v15, .v16, .v17)) {
                print(type(of: $0)) // UICollectionView
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct TabViewWithPageStyleType : IntrospectableViewType

TextEditor

  • An abstract representation of the TextEditor type in SwiftUI.

    struct ContentView: View {
        @State var text = "Lorem ipsum"
    
        var body: some View {
            TextEditor(text: $text)
                .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17)) {
                    print(type(of: $0)) // UITextView
                }
        }
    }
    

    Declaration

    Swift

    public struct TextEditorType : IntrospectableViewType

TextField

  • An abstract representation of the TextField type 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

    public struct TextFieldType : IntrospectableViewType

TextFieldWithVerticalAxis

  • An abstract representation of the TextField type in SwiftUI, with .vertical axis.

    struct ContentView: View {
        @State var text = "Lorem ipsum"
    
        var body: some View {
            TextField("Text Field", text: $text, axis: .vertical)
                .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17)) {
                    print(type(of: $0)) // UITextView
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct TextFieldWithVerticalAxisType : IntrospectableViewType

Toggle

  • An abstract representation of the Toggle type 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

    public struct ToggleType : IntrospectableViewType

ToggleWithSwitchStyle

  • An abstract representation of the Toggle type in SwiftUI, with .switch style.

    struct 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
                }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ToggleWithSwitchStyleType : IntrospectableViewType

Window

  • 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

    public struct WindowType : IntrospectableViewType
  • An abstract representation of the receiving SwiftUI view’s view controller, or the closest ancestor view controller if missing.

    struct ContentView: View {
        var body: some View {
            NavigationView {
                Text("Root").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red)
                    .introspect(.viewController, on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
                        print(type(of: $0)) // some subclass of UIHostingController
                    }
            }
            .navigationViewStyle(.stack)
            .introspect(.viewController, on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
                print(type(of: $0)) // UINavigationController
            }
        }
    }
    
    See more

    Declaration

    Swift

    public struct ViewControllerType : IntrospectableViewType

ViewWrapper

  • 通用UIView包装器

    See more

    Declaration

    Swift

    public struct ViewWrapper<T> : UIViewRepresentable where T : UIView

ViewControllerWrapper

  • 通用UIViewController包装器

    See more

    Declaration

    Swift

    public struct ViewControllerWrapper<T> : UIViewControllerRepresentable where T : UIViewController

ImageView

  • 图片视图,支持网络图片和动图

    See more

    Declaration

    Swift

    public struct ImageView : UIViewRepresentable

LoadingPluginView

  • 加载插件视图包装器

    See more

    Declaration

    Swift

    public struct LoadingPluginView : UIViewRepresentable

ProgressPluginView

  • 进度插件视图包装器

    See more

    Declaration

    Swift

    public struct ProgressPluginView : UIViewRepresentable

EmptyPluginView

  • 空界面插件视图包装器。如果需要显示空界面时可滚动,放到滚动视图内部即可

    See more

    Declaration

    Swift

    public struct EmptyPluginView : UIViewRepresentable
  • 网络图片视图,仅支持静态图

    See more

    Declaration

    Swift

    public struct WebImageView : View

OpacityButtonStyle

  • 透明度按钮样式,支持设置高亮和禁用时的透明度

    See more

    Declaration

    Swift

    public struct OpacityButtonStyle : ButtonStyle

LineShape

  • 线条形状,用于分割线、虚线等。自定义路径形状:Path { (path) in … } 常用分割线:Rectangle.foregroundColor替代Divider组件

    See more

    Declaration

    Swift

    public struct LineShape : Shape

RoundedCornerShape

RemovableModifier