Post

Replies

Boosts

Views

Activity

gesture(LongPressGesture()) issue with scroll view
I've being playing aground with long press gesture in scroll view and noticed gesture(LongPressGesture()) doesn't seem to work with scroll view's scrolling which doesn't seem to be the intended behavior to me. Take the following example: the blue rectangle is modified with onLongPressGesture and the red rectangle is modified with LongPressGesture (_EndedGesture<LongPressGesture> to be specific). ScrollView { Rectangle() .fill(.blue) .frame(width: 200, height: 200) .onLongPressGesture { print("onLongPressGesture performed") } onPressingChanged: { _ in print("onLongPressGesture changed") } .overlay { Text("onLongPressGesture") } Rectangle() .fill(.red) .frame(width: 200, height: 200) .gesture(LongPressGesture() .onEnded { _ in print("gesture ended") }) .overlay { Text("gesture(LongPressGesture)") } } If you start scrolling from either of the rectangles (that is, start scrolling with your finger on either of the rectangles), the ScrollView will scroll. However, if LongPressGesture is modified with either onChanged or .updating, ScrollView won't respond to scroll if the scroll is started from red rectangle. Even setting the maximumDistance to 0 won't help. As for its counter part onLongPressGesture, even though onPressingChanged to onLongPressGesture, scrolling still works if it's started from onLongPressGesture modified view. ScrollView { Rectangle() .fill(.blue) .frame(width: 200, height: 200) .onLongPressGesture { print("onLongPressGesture performed") } onPressingChanged: { _ in print("onLongPressGesture changed") } .overlay { Text("onLongPressGesture") } Rectangle() .fill(.red) .frame(width: 200, height: 200) .gesture(LongPressGesture(maximumDistance: 0) // scroll from the red rectangle won't work if I add either `updating` or `onChanged` but I put both here just to demonstrate // you will need to add `@GestureState private var isPressing = false` to your view body .updating($isPressing) { value, state, transaction in state = value print("gesture updating") } .onChanged { value in print("gesture changed") } .onEnded { _ in print("gesture ended") }) .overlay { Text("gesture(LongPressGesture)") } } This doesn't seem right to me. I would expect the view modified by LongPressGesture(), no matter if the gesture has onChanged or updating, should be able to start scroll in a scroll view, just like onLongPressGesture. I observed this behavior in a physical device running iOS 26.1, and I do not know the behavior on other versions.
0
0
51
Nov ’25
XCode reverts CoreData's .xccurrentversion
I am experiencing an issue where XCode reverts .xccurrentversion file in my iOS app to the first version whenever xcodebuild is run or whenever XCode is started. This means I can build the app and run tests in XCode if I discard the reversion .xccurrentversion on XCode start. However, testing on CI is impossible because the version the tests rely on are reverted whenever xcodebuild is run. The commands I run to reproduce the issue ❯ git status Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: Path/.xccurrentversion no changes added to commit (use "git add" and/or "git commit -a") ❯ git checkout "Path/.xccurrentversion" Updated 1 path from the index ❯ git status nothing to commit, working tree clean ❯ xcodebuild \ -scheme Scheme \ -configuration Configuration \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=latest' \ -skipPackagePluginValidation \ -skipMacroValidation \ test > /dev/null # test fails because model version is reverted ❯ git status HEAD detached at pull/249/merge Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: Path/.xccurrentversion no changes added to commit (use "git add" and/or "git commit -a") I have experienced such issue in 16.3 (16E140) and 16.2 (16C5032a). Similar issues/solutions I have found online are the following. But they are either not relevant or do not work in my case. https://stackoverflow.com/questions/17631587/xcode-modifies-current-coredata-model-version-at-every-launch https://github.com/CocoaPods/Xcodeproj/issues/81 Is anyone aware of any solution? Is there a recommended way I can run diagnostics on XCode and file a feedback?
15
0
285
Sep ’25