Solución:
La lista no requiere Array
. los Data
debe ajustarse a la RandomAccessCollection
protocolo. Este también podría ser tu NSFetchedResultsController
.
extension List {
/// Creates a List that computes its rows on demand from an underlying
/// collection of identified data.
@available(watchOS, unavailable)
public init<Data, RowContent>(
_: Data,
selection _: Binding<Selection>?,
rowContent _: @escaping (Data.Element.IdentifiedValue) -> RowContent
) where Content == ForEach<Data, HStack<RowContent>>,
Data: RandomAccessCollection,
RowContent: View,
Data.Element:
Identifiable
/// Creates a List that computes its rows on demand from an underlying
/// collection of identified data.
@available(watchOS, unavailable)
public init<Data, RowContent>(
_: Data,
selection _: Binding<Selection>?,
action _: @escaping (Data.Element.IdentifiedValue) -> Void,
rowContent _: @escaping (Data.Element.IdentifiedValue) -> RowContent
) where Content == ForEach<Data, Button<HStack<RowContent>>>,
Data: RandomAccessCollection,
RowContent: View, Dat
}
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)