-
Declaration
Swift
public var viewStore: ViewValues
-
Declaration
Swift
public var body: View { get }
-
Creates views based on uniquely identifiable data, by using a custom id.
The
id
value of each data should be unique.Declaration
Swift
public init(_ data: Data, id: KeyPath<Data.Element, ID>, content: @escaping (Data.Element) -> Content)
Parameters
data
The identified data that the
ForEach
instance uses to create views dynamically.id
A keypath for the value that uniquely identify each data.
content
The view builder that creates views dynamically.
-
Creates views based on uniquely identifiable data.
The
id
value of each data should be unique.Declaration
Swift
public init(_ data: Data, content: @escaping (Data.Element) -> Content)
Parameters
data
The identified data that the
ForEach
instance uses to create views dynamically.content
The view builder that creates views dynamically.
-
Creates an instance that computes views on demand over a constant range.
To compute views on demand over a dynamic range use
ForEach(_:id:content:)
.Declaration
Swift
public init(_ data: Range<Int>, content: @escaping (Int) -> Content)