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

Delay UIAlertController.onDismiss #201

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Delay UIAlertController.onDismiss #201

merged 1 commit into from
Aug 15, 2024

Conversation

stephencelis
Copy link
Member

Currently, onDismiss is called before the UIAlertAction is processed, which generally isn't an issue, but if you care about the order of operations, this can be a bit thorny. In the case of highly generalized navigation patterns in TCA, the order is what we use to emit warnings when invalid actions are received (like a dismiss action is received for an already-dismissed feature), so let's address the problem with a quick tick.

We could do this thread hop unconditionally if it makes sense to, but let's localize to UIAlertController for now.

Currently, `onDismiss` is called _before_ the `UIAlertAction` is
processed, which generally isn't an issue, but if you care about the
order of operations, this can be a bit thorny. In the case of highly
generalized navigation patterns in TCA, the order is what we use to emit
warnings when invalid actions are received (like a `dismiss` action is
received for an already-dismissed feature), so let's address the problem
with a quick tick.

We could do this thread hop unconditionally if it makes sense to, but
let's localize to `UIAlertController` for now.
@stephencelis stephencelis requested a review from mbrandonw August 14, 2024 17:54
@stephencelis stephencelis merged commit 42755eb into main Aug 15, 2024
7 checks passed
@stephencelis stephencelis deleted the delay-alert-dismiss branch August 15, 2024 16:53
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