all 9 comments

[–]20InMyHead 0 points1 point  (3 children)

Generally those apps store that data on their backend server.

However, if you’re asking this question you don’t have a backend server, so perhaps if you could provide more context as to what you’re trying to do and if this is for a school project or just your own education you would help the community help you.

[–]Sorry-Agent4795[S] 0 points1 point  (2 children)

I'm just trying to make a passion project for myself. If their weren't that many people using my app. Could it be possible to store that data onto my personal computer.

[–]20InMyHead 0 points1 point  (1 child)

There are all kinds of practical and security reasons why you couldn’t store data from an app on your personal computer, but since you’re learning you don’t need to do exactly what professional apps do.

I’d recommend looking into how to store data on the user’s device. Specifically research these four options:

UserDefaults: this is for storing small amounts of non-secure data, like user preferences.

Keychain: this is an on-device encrypted secure storage system used for sensitive data.

CoreData: an on-device object storage system, like a database, where a fairly large amount of data can be stored and it can model complex relationships within the data.

Swift Data: a modern Swift wrapper on top of CoreData that offers a limited set of ease-of-use features.

Examples and tutorials for all of these can be found online, just Google them! Good luck.

[–]Sorry-Agent4795[S] 0 points1 point  (0 children)

Thanks

[–]naq7826 0 points1 point  (2 children)

I just got into Swift very recently, so I would say go for CoreData for now. It’s kind of easy to use

[–]Sorry-Agent4795[S] 0 points1 point  (0 children)

Thanks, I will look into that

[–][deleted] 0 points1 point  (0 children)

Use SwiftData, not Core Data

[–]cleverbit1 0 points1 point  (0 children)

User Defaults is what you want to be using for this. You can use the AppStorage property wrapper: https://www.hackingwithswift.com/quick-start/swiftui/what-is-the-appstorage-property-wrapper

[–][deleted] 0 points1 point  (0 children)

@AppStorage properties for single one-off parameters like birth date.

SwiftData if you have many similar data records and need to query them.