The TabularData framework is pretty new (and I am new to Swift), so I haven't found much documentation on the internet. I need to import data from small spreadsheets (converted to .csv), and would like to use DataFrame but am running into the problem that a function cannot return an array (unless there is a premade struct to handle it). My csv files are small and only strings, but they change every day...I have up till now been reading them in line by line, but hope to use the new framework. print(dataframe) gives me just what I want, is there any way to inject it into my app without reading line by line?
if let testUrl = Bundle.main.url(forResource: "Timeslot template", withExtension: "csv") {
do{
let tsArray = try DataFrame(contentsOfCSVFile: testUrl, options: options)
print(tsArray) //How can I get this output into an array in the app?
} catch {
print(error)
}
}