title: How to make CareKitUI Bar Charts compatible with SwiftUI
body: <p>Currently, there is limited support for <a href="https://github.com/carekit-apple/CareKit" rel="nofollow noreferrer">CareKit</a> using SwiftUI.</p>
  <p>I understand, generally, the idea of making an object conforming to <code>UIViewRepresentable</code>, but am struggling to get going with how this would work in practice.</p>
  <p>The following is example code from the <a href="https://github.com/carekit-apple/CareKit#charts-" rel="nofollow noreferrer">readme</a>:</p>
  <pre class="lang-swift prettyprint-override"><code>let chartView = OCKCartesianChartView(type: .bar)
  
  chartView.headerView.titleLabel.text = &quot;Doxylamine&quot;
  
  chartView.graphView.dataSeries = [
      OCKDataSeries(values: [0, 1, 1, 2, 3, 3, 2], title: &quot;Doxylamine&quot;)
  ]
  </code></pre>
  <p>So the <code>init(type)</code>, <code>headerView.titleLabel</code> and <code>graphView.dataSeries</code> would need to be set as <code>@Binding</code> variables in a struct conforming to <code>UIViewRepresentable</code>, but I'm struggling to figure out how I have to use the following two functions:</p>
  <pre class="lang-swift prettyprint-override"><code>func makeUIView() {}
  
  func updateUIView() {}
  </code></pre>
  <p>Any help would be much appreciated.</p>