Saving data locally or on cloud

I know what I want to save in my app but I am unsure of what methods to implement.
Should I save data locally or on cloud. I want to make sure that once my user start using the app and has data saved in either ways above then even after accidentally deleting the app, if they reinstall the app the data still persist. How can I do this? Save locally or use cloud. If cloud should it be iCloud or Firebase?

Below is summary of what I am trying to do in detail.

  1. There is a counter in my app that the user uses. the counter has two variables. at the end of the day the app needs to read the values in the two variables and add it to a table view with date and time stamps. the counter resets the next day. How do I do this?

  2. I have a screen that shows list of prayers in table view. the user can add some of their favorite prayers in a separate tableview on another screen. also on the favorite screen they can rearrange rows to decide the sequence of prayers. This sequence data need to persist.

so for the above two bullet points my question is should I do it locally or cloud. I want data persistence even after user deletes the app. they must get everything back after a reinstall.

ANY HELP OR GUIDANCE WILL BE GREATLY APPRECIATED.

This would be cloud. Saving locally I believe if they delete the app their data goes with it.

Firebase or iCloud could work.

Firebase, they’d have to create an account to save their data (then if they delete the app, and redownload, they’d just have to log in again).

iCloud, I believe there’s a way to just “automatically” connect to their account so when they redownload, their data will come back

Because what you’re saving is so simple, you could create a JSON file in their Files app on their phone and then read/update that file whenever you need the data

Thanks my friend. Does iCloud work with core data or is it independent of core data?

I believe they are independent. Someone else may need to chime in.

CoreData is for storing data locally, but I’m not 100% sure if it’s related at all to iCloud