Posts

Post not yet marked as solved
0 Replies
144 Views
I have a peculiar situation, where the first time I present a sheet from a Section that has the header: set, the sheet disappears by itself the first time it is presented. @State private var show = false // … List { Section { Text("foo") } header: { Text("bar") } .sheet(isPresented: $show) { Text("baz") } // just to enable Button("toggle") { show = true } } In Xcode I get this warning when I present the sheet (taken from our live app): Attempt to present <_TtGC7SwiftUI29PresentationHostingControllerVS_7AnyView_: 0x10a819e00> on <_TtGC7SwiftUI19UIHostingControllerGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier__: 0x10a020600> (from <_TtGC7SwiftUI32NavigationStackHostingControllerVS_7AnyView_: 0x10a0cba00>) while a presentation is in progress. Tested on iOS 17.4.1, iPadOS 17.4.0 (Simulator), Xcode 15.3 Previews.  Circumstances The circumstances are as following: a Section has to be in a List, and have content:, and header: or footer: set to something, and have the .sheet(…) set on the section itself. The problem does not occur with these sections: Section { Text("…") } Section { } footer: { Text("…") } Section { Text("…") } header: { } … but the following views have the sheet disappear the first time it is presented: Section { Text("…") } header: { Text("…") } Section { Text("…") } footer: { Text("…") } Section { Text("…") } header: { Text("…") } footer: { Text("…") } Is this a known issue, and are there any known workarounds to present from a Section? My best guess is to move the .sheet(…) to the parent container, but I'll have to restructure part of my code quite a bit to do so 😕
Posted
by vladimirs.
Last updated
.
Post not yet marked as solved
0 Replies
138 Views
I wonder if it is possible to modify my application's accessibility text size from within the app, similar to setting the brightness with UIScreen.main.brightness = myBrightness. I've attempted setting .dynamicTypeSize(…) on my main view, but that setting does not get propagated when displaying sheets or popovers.
Posted
by vladimirs.
Last updated
.
Post not yet marked as solved
2 Replies
191 Views
When I dismiss a popover and quickly try to navigate to another view by tapping a NavigationLink, both the current view's and the new view's bottom bars momentarily display on-top of each other. Specifically, this only occurs if I first dismiss the popover by tapping outside of it, then tapping a link before the popover finishes it's dismissal animation. However, this does not happen if i directly tap a visible NavigationLink when the popover is open (weird). This issue almost always happens when using a List with NavigationLinks inside it, where both toolbars appear momentarily. I assume this is because each row does not act as a button, and you inherently need to tap twice to navigate from a List. Is this issue known, and are there workarounds? My current solution, in my own code, to not show this to users is by disabling the List when my popover is showing (….disabled(showSettings)). This code demonstrates my problem: struct ListNavigationPopoverDuplicateBottomBar: View { @State private var popover = false var body: some View { NavigationStack { NavigationLink { Text("").toolbar { // new view's bottom bar item ToolbarItem(placement: .bottomBar) { Text("Second toolbar") } } } label: { Text("Link") } .toolbar { ToolbarItem(placement: .topBarTrailing) { // button to show popover. (same problem regardless if placed here or directly in the main view) Button("Popover") { popover = true } .popover(isPresented: $popover) { Text("A popover") } } ToolbarItem(placement: .bottomBar) { // first bottom bar Text("First toolbar") } } } } } Steps to reproduce: Open popover Tap empty space (do not tap the NavigationLink) Quickly tap the NavigationLink before the popover dismissal animation finishes First post in this forum, please tell me if this is not the right place for this.
Posted
by vladimirs.
Last updated
.