UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

How to get Data in my App

Forums > SwiftUI

Hello,

I'm wondering already since months, how i can get my produced data (csv for example) into my swiftui-project and converted to core-Data. What I'm asking myself: The convertion from csv to an entity or an array of entity, must only happen once, the app is installed. I already figured out how to convert csv into a DataModel, but everytime the app is closed and reopend again, the same function "fetchData()" has to run again, which causes the app to pause for a couple of seconds.

Is there any good way to produce Data (in what form so ever) before programming the app and then somehow "import" it?

An example:

Say, i wanted to create an Array of Books (title, author, rating) and before i code the app, i produce a csv-file (or something else). Is there a possibility to import this?

Thanks for you help!

Greetings Nico

2      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.