0

I'm just learning about Core Data in Xcode. I want certain data to already be stored when the app is opened for the first time.

Is the best way to do this, by checking every time when the app opens, if the data exists, then adding it programmatically if it doesn't? It seems like a simple enough solution, but messy to run every time the app opens?

Thanks for the help!

Joakim Danielson
  • 43,251
  • 5
  • 22
  • 52
Muindor
  • 177
  • 1
  • 9

1 Answers1

0

Note: App launch has to be happen very quickly. if not your app has the chance to be getting rejected in the AppReview. WatchDog checks for your app lauchtime on review.

Answer to your question. No, you should not have database contact on every launch.

Hint: If you need to check the state of the app, like already logged in state. those flags and all you can add it UserDefaults. that may reduce the lauchtime. if you need data migration from coredata, you have to do in background once app launched.

karthik
  • 621
  • 4
  • 14
  • 1
    Thank you for the help! Turns out I was approaching it completely the wrong way. I just needed to use a plist. – Muindor Mar 20 '19 at 22:18