nalexn / clean-architecture-swiftui

SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

test notification opens current detail instead of the payload one then crashes

pacu opened this issue · comments

commented

When dragging the notification file to the simulator, routing is inconsistent.

Example:

Let app be in the country list screen
drag notification file to simulator
app routes to Andorra's flag detail ✅

Let app be in Belgium detail
drag notification file to simulator
app routes to Belgium's flag detail
[Crash] when user taps close on Belgium's flag detail❌

CountriesSwiftUI[7277:216049] Warning: Attempt to present <_TtGC7SwiftUIP13$7fff2c9e0f5c22SheetHostingControllerVS_7AnyView_: 0x7fa0dd8638b0>  on <_TtGC7SwiftUIP13$7fff2c9eec3028DestinationHostingControllerVS_7AnyView_: 0x7fa0dd947b60> which is already presenting (null)
(lldb) 

Xcode: 11.6

Hey @pacu

Thanks for finding this edge case. This is clearly a bug in SwiftUI, and sadly it's present in iOS 14 as well.
I've enrolled a workaround, where the navigation state is reset to default first and after a delay routes to where it suppose to be.