目前,使用 SwiftUI 对CareKit的支持有限。
我通常理解使对象符合 的想法UIViewRepresentable,但我正在努力了解这在实践中的工作方式。
以下是自述文件中的示例代码:
let chartView = OCKCartesianChartView(type: .bar)
chartView.headerView.titleLabel.text = "Doxylamine"
chartView.graphView.dataSeries = [
OCKDataSeries(values: [0, 1, 1, 2, 3, 3, 2], title: "Doxylamine")
]
所以init(type),headerView.titleLabel和graphView.dataSeries需要设置为@Binding结构中的变量UIViewRepresentable,但我正在努力弄清楚我必须如何使用以下两个函数:
func makeUIView() {}
func updateUIView() {}
任何帮助将非常感激。