Group Group Group Group Group Group Group Group Group

SwiftUi and CloudKit

As we all know in the previous version of Xcode we used Table Views to list out our data collected from iCloud. I Have used it many times in my app.
With the new Xcode 11 and SwiftUI I am at a loss to get CloudKit to use the List controls to show my data.
Does anyone have a sample or tutorial that can guide me down this new path?
T Riley
Ladybug Development

@triley52501 Do you still have issues with this?

Yes although I spotted a video yesterday on how to use cloud kit in SwiftUI I haven’t attacked it yet but it didn’t look that simple either. Why do you have a solution?

Hi @triley52501,
I do not have any code for you, but here’s how you can do that.

  1. If you get your data from cloudKit then you can use a List item and display your data as a TableView in SwiftUI

  2. In SwiftUI the UI elements need to bind to a state or a data source, so you will need to have a datasource in the form of a Binding or Observable that populates the data from CloudKit and displays it using List items on the UI. This would also hinge a bit on combine.

You can look at the books on SwiftUI, Combine from the store for more details on these topics.

cheers,