reduce(value:nextValue:)
Combines a sequence of values by modifying the previously-accumulated value with the result of a closure that provides the next value.
Declaration
static func reduce(value: inout Self.Value, nextValue: () -> Self.Value)Parameters
- value:
The value accumulated through previous calls to this method. The implementation should modify this value.
- nextValue:
A closure that returns the next value in the sequence.
Discussion
This method receives its values in view-tree order. Conceptually, this combines the preference value from one tree with that of its next sibling.