Loadability Documentation Beta

Structure Load

public struct Load<Loader: SomeLoader, Value, Content: View, PlaceholderContent: View>: View

A view that loads content using a Loader before displaying the content in a custom View.

%3 Load Load View View Load->View

Conforms To

View

Initializers

init(with:​key:​object​Key​Path:​content:​placeholder:​)

public init(with loader: Loader, key: Loader.Key, objectKeyPath: KeyPath<Loader.Object, Value?>, content contentBuilder: @escaping (Value) -> Content, placeholder placeholderContentBuilder: @escaping () -> PlaceholderContent)

init(with:​key:​object​Key​Path:​placeholder​View:​content:​)

public init<P: HasPlaceholder>(with loader: Loader, key: Loader.Key, objectKeyPath: KeyPath<Loader.Object, Value?>, placeholderView: P.Type, content contentBuilder: @escaping (Value) -> Content) where PlaceholderContent == P.Placeholder

Properties

body

var body: some View

Methods

displaying​Errors(_:​)

public func displayingErrors(_ alertContent: ((Error) -> Alert)?) -> some View

Presents an alert to the user if an error occurs.

Parameters

alert​Content ((Error) -> Alert)?

Content to display in the alert.