Post

Replies

Boosts

Views

Activity

Comment on Offset on tap items when reopening app with a sheet open
Ah my bad—that usage of an enum named Sheet to represent the possible sheets is specific to my case. I should have used a simpler example to explain how to use this. In the conventional case of using @State var showingSheet: Bool = false, you would then have something like func showingSheetChanged(to newValue: Bool) { TapTargetResetLayer.presentedSheetChanged(toDismissed: newValue == false) }. The point being to let it know when the sheet dismisses so it can do its thing.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
Comment on Offset on tap items when reopening app with a sheet open
I've updated my answer to this on StackOverflow with the conventional use of .sheet, if that helps.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Comment on Offset on tap items when reopening app with a sheet open
In response to your second question—how else do you intend for it to work, if not for presenting with .sheet? As far as I'm aware of, that's the only situation in which the bug occurs—as it doesn't seem to happen when using a .fullScreenCover.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Comment on Offset on tap items when reopening app with a sheet open
Ah my bad—that usage of an enum named Sheet to represent the possible sheets is specific to my case. I should have used a simpler example to explain how to use this. In the conventional case of using @State var showingSheet: Bool = false, you would then have something like func showingSheetChanged(to newValue: Bool) { TapTargetResetLayer.presentedSheetChanged(toDismissed: newValue == false) }. The point being to let it know when the sheet dismisses so it can do its thing.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23