Skip to content
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

Fix support for non-string keys in dictionaries #149

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

sindresorhus
Copy link
Owner

@sindresorhus sindresorhus commented Sep 10, 2023

UserDefaults#set(dictionary, forKey: ...) only supports a string-keyed dictionary. If you try to set [1: true], it currently throws an Objective-C exception.

Copy link
Collaborator

@hank121314 hank121314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! True! Many Thanks for the fix 🙌!

@sindresorhus sindresorhus merged commit 3efef5a into main Sep 14, 2023
4 checks passed
@sindresorhus sindresorhus deleted the fix-dicitonary-string-keys branch September 14, 2023 13:42
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.

None yet

2 participants