-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
DismissEffect does not work on iOS14 #2233
Comments
@sk409 Can you attach a sample project reproducing the problem? The issue doesn't have enough to go by. Note that the |
This is the sample project to reproduce. https://github.com/sk409/DismissEffectSample The code using the DismissEffect is below. https://github.com/sk409/DismissEffectSample/blob/main/Test/ContentView.swift |
I'm using DismissEffect in the correct order, so it's working on iOS15 and iOS16. |
@sk409 Yup! I took a look at your code but need to download the iOS 14 runtime sometime later today to investigate. It may just have to do with the fact that programmatic navigation in SwiftUI is quite buggy. It's better in iOS 16.4 and 17, but previous iOSes do not perform well when it comes to navigation. |
Fixes #2233. On iOS 14, `DismissEffect` is broken because effect cancellation uses `AnyHashable` throughout, which can lead to nested `AnyHashable(AnyHashable(...))` IDs, which can hash differently depending on the level of nesting. By preserving the hashable ID up to being stored in the internal cancellation token type, we can avoid a hash lookup failure that prevents a dismissal from happening.
Thanks again for the repro! Finally had a chance to sit down with this today and have a fix here: #2283. Please confirm that it fixes the problem for you! |
Fixes #2233. On iOS 14, `DismissEffect` is broken because effect cancellation uses `AnyHashable` throughout, which can lead to nested `AnyHashable(AnyHashable(...))` IDs, which can hash differently depending on the level of nesting. By preserving the hashable ID up to being stored in the internal cancellation token type, we can avoid a hash lookup failure that prevents a dismissal from happening.
@stephencelis |
* Fix cancellation ID existentials in iOS 14 Fixes #2233. On iOS 14, `DismissEffect` is broken because effect cancellation uses `AnyHashable` throughout, which can lead to nested `AnyHashable(AnyHashable(...))` IDs, which can hash differently depending on the level of nesting. By preserving the hashable ID up to being stored in the internal cancellation token type, we can avoid a hash lookup failure that prevents a dismissal from happening. * wip
Description
DismissEffect does not work on iOS14.
Nothing happens when I run the code below on iOS14.
Checklist
main
branch of this package.Expected behavior
Screen closes after executing DismissEffect.
Actual behavior
Screen does not close after executing DismissEffect.
Steps to reproduce
The Composable Architecture version information
0.54.1
Destination operating system
iOS 14.5
Xcode version information
14.3
Swift Compiler version information
The text was updated successfully, but these errors were encountered: