SwiftUI LongPressGesture does not work as expected in Xcode Version 16.0 (16A242) and iOS 18

When I copy and paste example code in apple developer documentation, LongPressGesture does not work as expected in Xcode Version 16.0 (16A242) and iOS 18. It seems updating(_:body:) method does not work when used with LongPressGesture. When I make a breakpoint in updating(_:body:) method and long press the blue circle on the screen of simulator(or device), it is expected to be caught in breakpoint or it is expected that color of circle turns from blue to red to green. However, it is not caught in breakpoint and never turns to red. Question of Stackoverflow is about same issue and I can not use onLongPressGesture method to implement required feature of my app.

I submitted bug report via Feedback Assistant and my report's ID is FB15127375 and FB15173175. Please tell me if there is any investigation about this issue.

Development environment: Xcode Version 16.0 (16A242), macOS 14.5 Run-time configuration: iOS 18.0

Answered by DTS Engineer in 807117022

Hello, I can confirm that both bugs you filed are indeed open and under investigation. In one bug I can see that engineering has confirmed that .onChanged() is also not being called for the LongPressGesture. That's all I can tell you for now as our policy does not allow comments about future business.

I recommend following up with your bugs and testing your software in system software updates as they are made available. That includes testing in pre-release versions of system software available through your developer account. Please see https://developer.apple.com/download/.

Hello, I can confirm that both bugs you filed are indeed open and under investigation. In one bug I can see that engineering has confirmed that .onChanged() is also not being called for the LongPressGesture. That's all I can tell you for now as our policy does not allow comments about future business.

I recommend following up with your bugs and testing your software in system software updates as they are made available. That includes testing in pre-release versions of system software available through your developer account. Please see https://developer.apple.com/download/.

SwiftUI LongPressGesture does not work as expected in Xcode Version 16.0 (16A242) and iOS 18
 
 
Q