LineChartWrapper.swift 607 B

123456789101112131415161718192021
  1. // LoopFollow
  2. // LineChartWrapper.swift
  3. import Charts
  4. import SwiftUI
  5. struct LineChartWrapper: UIViewRepresentable {
  6. let chartView: LineChartView
  7. func makeUIView(context _: Context) -> LineChartView {
  8. chartView
  9. }
  10. func updateUIView(_: LineChartView, context _: Context) {
  11. // Intentionally empty. MainViewController owns the chart and calls
  12. // notifyDataSetChanged itself whenever it mutates the data; doing it
  13. // here too would redo that work on every unrelated SwiftUI re-render
  14. // of MainHomeView (e.g. the once-a-second minAgoText tick).
  15. }
  16. }