TableStyle

A type that applies a custom appearance to all tables within a view.

ProtocoliOS 16.0+macOS 12.0+TableStyle in SwiftUI

Declaration

React
type TableStyle =
  | 'automatic'
  | 'inset'
  | AutomaticTableStyle
  | InsetTableStyle;
Swift
@MainActor @preconcurrency protocol TableStyle

Pass a literal, or build one with SwiftUI.TableStyle from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • 'automatic'SwiftUI.TableStyle.automatic

    The default table style in the current context.

  • 'inset'SwiftUI.TableStyle.inset

    The table style that describes the behavior and appearance of a table with its content and selection inset from the table edges.

Overview

To configure the current table style for a view hierarchy, use the View.tableStyle(_:) modifier.

A type conforming to this protocol inherits @preconcurrency @MainActor isolation from the protocol if the conformance is included in the type's base declaration:

struct MyCustomType: Transition {
    // `@preconcurrency @MainActor` isolation by default
}

Isolation to the main actor is the default, but it's not required. Declare the conformance in an extension to opt out of main actor isolation:

extension MyCustomType: Transition {
    // `nonisolated` by default
}

From Apple’s SwiftUI documentation. Code samples there are Swift.

Used by

See also

More in Styles.