Hello again,
I have no ides where to start with this. I am using SwiftUI for Mac OS and I need to be able to create a Data Frame straight from the JSON returned from an API call. So far I have been using Table since I know what the JSON will contain. Now I need a way to get the JSON data straight to a a table that I can display in Swift UI because the contents will vary. I think I need to use @dynamicMemberLookup struct DataFrame
with the init(jsonData: Data, columns: [String]?, types: [String : JSONType], options: JSONReadingOptions) throws
init method, but I am not sure how to set it up and where to set it up. My app is a view-data-model structure:
- A SwiftUI view that calls the functions to search the APIs.
- A class that contains all of the API search functions. The returned JSON data is parsed here for the dataModel
- A dataModel with structures for the json data.
The data from the dataModel gets returned to the SwiftUI as a @State variable data = [dataModel]()
I would assume the DataFrame would go in the SwiftUI view but I am not sure how to get the JSON data to the Dataframe since I am not going to decode it to a dataModel. Any help Appreciated! Thanks!