Files
ChartView/Sources/SwiftUICharts/Base/Common/ViewPreferenceKey.swift
T
Andras Samu ebaaf81d19 feat: new protocol for chained functions, and added support for expli… (#252)
* feat: new protocol for chained functions, and added support for explicit Y ranges. X coming as well

* feat: add new axis interface (#253)
2022-10-24 16:07:51 +02:00

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())
}
}