Skip to content

Perform Keychain operations asynchronously on a non-main thread. #536

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

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

adamgic
Copy link
Contributor

@adamgic adamgic commented Mar 7, 2023

Change to perform Keychain operations asynchronously on a non-main thread.

Apple suggest in documentation, that Keychain operations should be called from non-main thread to avoid undesired/unpredictable behaviour on the UI side:

quote
Performance considerations
SecItemCopyMatching blocks the calling thread, so it can cause your app’s UI to hang if called from the main thread. Instead, call SecItemCopyMatching from a background dispatch queue or async function.
unquote
https://developer.apple.com/documentation/security/1398306-secitemcopymatching

@juliansteenbakker
Copy link
Owner

Thanks for your change, LGTM!

@juliansteenbakker juliansteenbakker merged commit 6ce7965 into juliansteenbakker:develop Jun 27, 2023
@devmil
Copy link

devmil commented Jul 12, 2023

@juliansteenbakker Is there already a plan for when this will be released?

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.

3 participants