Skip to content

Initialize user defaults with a custom domain #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

lukkob
Copy link

@lukkob lukkob commented Oct 22, 2021

Usage of UserDefaults.standard without any domain caused that all user's data was cleared every time the method stop() was called, not only data previously set in this class. I've changed UserDefaults.standard to UserDefaults(suiteName: USER_DEFAULTS_DOMAIN) to be able to remove only those preferences which we want to be cleared in this case.

@Dev-hwang
Copy link
Owner

thank you @lukkob

I was not aware of this problem until now. I'm not familiar with UserDefaults(suiteName:), so I'll check the official documentation and merge the branch.

Thank you again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants