Post

Replies

Boosts

Views

Activity

Reply to Illegible navigation title when presenting Map view
@T.P: Apple has not responded to my ticket. For iOS 26.0, I've worked around the issue as follows: Original Code import MapKit import SwiftUI struct Demo: View { var body: some View { NavigationStack { Map() .navigationTitle(Text("Choose Location")) .navigationBarTitleDisplayMode(.inline) } } } Updated Code import MapKit import SwiftUI struct Demo: View { var body: some View { NavigationStack { Map() .navigationTitle(Text("Choose Location")) .navigationBarTitleDisplayMode(.inline) .preserveNavigationBarViaSafeAreaInset() } } } private extension View { // HACK: Work around https://developer.apple.com/forums//thread/794351 func preserveNavigationBarViaSafeAreaInset() -> some View { Color.clear .safeAreaInset(edge: .bottom) { self } } } Before After
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’25
Reply to `onTapGesture` not triggered on `Map` views
An update regarding the state of this issue as of iOS 26.1 beta 1 Using 26.1 beta 1 (23B5044k), I tested this issue using the sample code provided with the original post, and there's a partial fix in this build of iOS 26.1, but there's a noticeable performance issue that folks will likely want to keep in mind. There's a significant regression between the responsive UI experience that was present in iOS 18.6 and the high-latency UI experience now present in iOS 26.1. I'll try to summarize how the behavior varies across OS versions: iOS 18.6: onTapGesture triggers callback nearly instantly iOS 26.0: onTapGesture fails to trigger callback at all iOS 26.1: onTapGesture eventually triggers callback, but there's a significant delay that causes the app to feel unresponsive Demo The attached gif attempts to show the delay, but it feels much more apparent when you're using an app yourself and you sense the delay between when you personally tap on the screen and when the screen updates. The gif shows the follow: Using onTapGesture in iOS 18.6: ~100ms between when the user taps and when the view updates to show the GPS coordinates of the tapped location Using simultaneousGesture in iOS 26.1: ~100ms between when the user taps and when the view updates to show the GPS coordinates of the tapped location. (simultaneousGesture is the workaround demonstrated in https://developer.apple.com/forums/thread/795909?answerId=855111022#855111022.) Using onTapGesture in iOS 26.1: ~400ms between when the user taps and when the view updates to show the GPS coordinates of the tapped location Unresponsive UI To me, the latency of using onTapGesture in iOS 26.1 beta 1 (simulator version 23B5044k) is too severe. Knowing that Apple cares about apps feeling responsive to touch, I don't think that Apple would accept this latency in Apple's first-party apps. Along those same lines, I plan to stick with the simultaneousGesture workaround until onTapGesture is as responsive in iOS 26.x as it was in iOS 18.6. I hope this perspective is helpful.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to `onTapGesture` not triggered on `Map` views
Thanks so much for that suggestion, @DTS Engineer! That approach does indeed fire the callback for a tap. But in my particular case, I need the screen coordinate of the tap, and I don't see a way to get that using TapGesture().onEnded {}. However, I found that SpatialTapGesture does provide the screen coordinate of the tap. Here's what this workaround looks like applied to the code sample from the OP: import MapKit import SwiftUI struct ContentView: View { @State private var location = CGPoint.zero var body: some View { Map() .simultaneousGesture(SpatialTapGesture() .onEnded { event in self.location = event.location } ).safeAreaInset(edge: .bottom) { VStack(alignment: .center) { Text("iOS \(UIDevice.current.systemVersion)") .font(.largeTitle) Text("Tapped Location") Text("\(location.x), \(location.y)") } .frame(maxWidth: .infinity, alignment: .center) .background(.background) } } } That seems to work well in my testing! I'll adopt this workaround for now. Thanks for your help! Docs: https://developer.apple.com/documentation/swiftui/tapgesture https://developer.apple.com/documentation/swiftui/spatialtapgesture
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to `onTapGesture` not triggered on `Map` views
FYI: I tested this using the new releases published today, and this issue still exists. Specifically, I observed the issue when: Developing in Xcode beta 6 (17A5305f) running iOS 26 SDK beta 6 (23A5324a) in the simulator Running the sample app on a physical iPhone running iOS 26 beta 7 (23A5326a)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25