Post

Replies

Boosts

Views

Activity

SimultaneousGesture.updating(_:body:) does not always reset
I've got another issue with Gesture.updating(_:body:).. This looks a bit like this thread, but it's different. My problem occurs when creating a simultaneous gesture combining a RotateGesture with a MagnifyGesture. struct ManipulationState: Equatable { var magnification: CGFloat? var rotation: Angle? } @GestureState var state: ManipulationState? = nil var gesture: GestureStateGesture<SimultaneousGesture<RotateGesture, MagnifyGesture>, ManipulationState?> { SimultaneousGesture( RotateGesture(minimumAngleDelta: .degrees(5)), MagnifyGesture(minimumScaleDelta: 0.1) ) .updating($state) { value, state, transaction in state = ManipulationState( magnification: value.second?.magnification, rotation: value.first?.rotation ) } } When rotating and magnifying quite a bit, at some point, something happens, the gesture stops working altogether and the state never resets to the initial value any more. When adding an onChange handler to some view in the body, you can watch state never gets nil again. .onChange(of: state, { oldValue, newValue in print("\(oldValue) \(newValue)") }) I noticed the same happening when using ExclusiveGesture instead of SimultaneousGesture. Full code example here: https://github.com/teameh/GestureIssueTester/blob/main/GestureTester/ContentView.swift Video demonstrating issue here: https://github.com/teameh/GestureIssueTester/raw/refs/heads/main/screen-recording.mov I've tried using Gesture.onChanged(_:) and Gesture.onEnded(_:)as well, butonEnded` is also not always called. Is there anyone here who ran into the same problem or perhaps someone can share tips on a workaround or a fix? Tested using Xcode 16.0 (16A242d)
3
0
229
Oct ’24
Is there a way to preview an App Clip invocation with a NFC or QR code?
In the video Streamline your App Clip at 16:05 - https://developer.apple.com/videos/play/wwdc2020/10120/?t=965 Luming demonstrates how scanning a QR code will invoke the App Clip he just build with XCode. I can't reproduce this. So far I've: Adding a smart banner to our website Added entry to apple-app-site-association Created an App Clip Declared the Associated Domains capability Implemented func respondTo(_ activity: NSUserActivity?) { Am I missing something, or is this just not possible with debug apps? Or should we rely on passing the _XCAppClipURL variable - https://developer.apple.com/documentation/app_clips/distributing_your_app_clip_to_testers and using the actions in testflight later when using Testflight when App Clips will be available later this year?
2
0
841
Jun ’20