Home > Software design >  Swift 5 Where are NSUserDefault.standard value stored on macOS
Swift 5 Where are NSUserDefault.standard value stored on macOS

Time:08-24

I have a macOS project Swift 5. I need to store userDefault values. Based on the values users will be granted access to premium features of my app. I like to know if a user is able to view files on their macOS operating system to retrieve the userDefault.standard values.

Basically trying to prevent users from hacking the app. Will users have access and able to change the userDefault values from there file system on there macOS

Example

UserDefaults.standard(true, forKey: "premium")

can a user edit a file on system to change this value. "where/the/path/to/user/defaults"

CodePudding user response:

A user will be able to view them with appropriate tools and alter them. For sensitive information, Id recommends using Keychain. Even better have this logic implemented on the server side to give you full control over this feature.

  • Related