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
.
Relationships
Conforms To
View
Initializers
init(with:key:objectKeyPath: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:objectKeyPath:placeholderView: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
displayingErrors(_:)
public func displayingErrors(_ alertContent: ((Error) -> Alert)?) -> some View
Presents an alert to the user if an error occurs.
Parameters
Name | Type | Description |
---|---|---|
alertContent | ((Error) -> Alert)? |
Content to display in the alert. |