Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Sep 16, 2025

WOOMOB-1259

Description

This pull request addresses a change in gesture recognizer behavior observed on newer iOS SDKs. The gestureRecognizer(_:shouldBeRequiredToFailBy:) delegate method was being unexpectedly triggered by simple taps on UI elements like text fields, even when no swipe gesture was performed. This is likely due to internal refinements in how UIKit handles gesture recognition. To make our conditional swipe-back logic more robust and explicit, this change replaces the previous implementation with gestureRecognizerShouldBegin(_:). This is the standard and more direct method for conditionally enabling or disabling a gesture, ensuring our code is more resilient to future iOS updates.

Consider checking out the video attached to the task for clarity.

Testing steps

In manual testing our objective is to make sure that the "swipe back" gesture is properly detected and "Discard changes" wall is presented where needed - both on iOS 18 and iOS 26. The device testing is preferred to have proper swipe back gesture.

Testing steps Xcode 16.x + iOS 16.x

  • Build and run the app with Xcode 16.x + iOS 18.x Device.
  • Navigate to a product details screen
  • Tap on "Price" field to open price settings
  • Tap on "Schedule sale" toggle to reveal date settings
  • Tap on "From" or "To" date to reveal the date picker. Tap on the date picker
  • Make sure the date rows and date picker are interactive and work as expected
  • Make sure the "Discard changes" dialogue doesn't pop up when tapping on various fields on "Price" editing screen
  • Tap on the "back" item in navigation bar. Make sure the "Discard changes" dialogue pops up. Close the dialogue.
  • Do the swipe back gesture. Make sure the "Discard changes" dialogue pops up. Close the dialogue.

Testing steps Xcode 26 + iOS 26

  • Build and run the app with Xcode 26 + iOS 26 device.
  • Repeat the same steps as in scenario above.

Testing information

Tested on iOS 18.4 device iOS 26 simulator. Confirmed the back swipe works on both OS versions detecting unsaved changes.


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@RafaelKayumov RafaelKayumov added this to the 23.3 milestone Sep 16, 2025
@RafaelKayumov RafaelKayumov added type: task An internally driven task. Bug iOS 26 Specific to iOS 26 labels Sep 16, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 16, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16133-6335050
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commit6335050
Installation URL72fcthu50ep40
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@RafaelKayumov RafaelKayumov marked this pull request as ready for review September 16, 2025 21:14
@itsmeichigo itsmeichigo self-assigned this Sep 18, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the change with simulator 26.0 and confirmed that this fixes the issue ✅

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 23.3. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@RafaelKayumov RafaelKayumov merged commit c4cad38 into trunk Sep 18, 2025
13 of 14 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-1259-fix-back-swipe-gesture-check branch September 18, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug iOS 26 Specific to iOS 26 type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants