ebaaf81d19
* feat: new protocol for chained functions, and added support for explicit Y ranges. X coming as well * feat: add new axis interface (#253)
16 lines
349 B
Swift
16 lines
349 B
Swift
import SwiftUI
|
|
|
|
public protocol ViewPreferenceKey: PreferenceKey {
|
|
typealias Value = [ViewSizeData]
|
|
}
|
|
|
|
public extension ViewPreferenceKey {
|
|
static var defaultValue: [ViewSizeData] {
|
|
[]
|
|
}
|
|
|
|
static func reduce(value: inout [ViewSizeData], nextValue: () -> [ViewSizeData]) {
|
|
value.append(contentsOf: nextValue())
|
|
}
|
|
}
|