TypeErasedView

public protocol TypeErasedView

Type-erased View w.r.t. the Body associated type.

  • The primary layout axis of the view. This is used by the SwiftWeb layout system to generate CSS properties mimicking the SwiftUI layout system. By default, all HTML elements in SwiftWeb are aligned in the .vertical axis.

    Declaration

    Swift

    var layoutAxis: LayoutAxis { get }
  • Defines the generation of HTML representing the view.

    Declaration

    Swift

    func html(forHTMLOfSubnodes: [HTMLNode]) -> HTMLNode
  • Transforms this view with the supplied closure argument. Can be overridden by Views by implementing the CustomMappable protocol in order to represent multiple subviews. This method is used by SwiftWeb for instantiating the view tree during runtime.

    Declaration

    Swift

    func map<T>(_ transform: (TypeErasedView) -> T) -> [T]
  • Helper method which transforms the body of a view if the Body type is not equal to Never, returns an empty array otherwise.

    Declaration

    Swift

    func mapBody<T>(_ transform: (TypeErasedView) -> T) -> [T]

View description

  • debugDescription Extension method

    Undocumented

    Declaration

    Swift

    var debugDescription: String { get }
  • anyView() Extension method

    Undocumented

    Declaration

    Swift

    func anyView() -> AnyView