From 983bd6561717a7a0f9c773441a1e64f0eb452e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirin=20Svins=C3=A5s?= Date: Wed, 5 Nov 2025 10:34:41 +0100 Subject: [PATCH 1/2] add m_longPressDetected in TouchEffectTapGestureRecognizer --- CHANGELOG.md | 3 +++ .../Touch/iOS/TouchEffectTapGestureRecognizer.cs | 11 ++++++++++- .../Effects/Touch/iOS/TouchPlatformEffect.cs | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d85db8266..6fa0917ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [53.6.1] +- [iOS] Fixed so Touch.Command will not be executed when long press is recognized. + ## [53.6.1] - [AlertView][Android] Fixed bug where buttons would not be visible if text size was increased and the Alert was not large. - [AlertView][iOS] Fixed bug where `AlertView` would not show the custom truncation text if its visibility were set to false at the start. diff --git a/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectTapGestureRecognizer.cs b/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectTapGestureRecognizer.cs index d31311002..cf63ec145 100644 --- a/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectTapGestureRecognizer.cs +++ b/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectTapGestureRecognizer.cs @@ -9,6 +9,7 @@ public class TouchEffectTapGestureRecognizer : UIGestureRecognizer { private UIView? m_uiView; private readonly Action m_onTap; + private bool m_longPressDetected; internal UIGestureRecognizerState m_currentState = UIGestureRecognizerState.Possible; @@ -37,6 +38,7 @@ public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); + m_longPressDetected = false; m_isCancelled = false; TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Began, ref m_currentState, m_uiView); @@ -46,10 +48,11 @@ public override void TouchesEnded(NSSet touches, UIEvent evt) { base.TouchesEnded(touches, evt); - if(m_currentState is not UIGestureRecognizerState.Cancelled) + if(!m_longPressDetected && m_currentState is not UIGestureRecognizerState.Cancelled) m_onTap.Invoke(); TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Ended, ref m_currentState, m_uiView); + m_longPressDetected = false; } public override void TouchesCancelled(NSSet touches, UIEvent evt) @@ -57,6 +60,7 @@ public override void TouchesCancelled(NSSet touches, UIEvent evt) base.TouchesCancelled(touches, evt); TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Cancelled, ref m_currentState, m_uiView); + m_longPressDetected = false; } public override void TouchesMoved(NSSet touches, UIEvent evt) @@ -79,6 +83,11 @@ public override void TouchesMoved(NSSet touches, UIEvent evt) private CGPoint? GetTouchPoint(NSSet touches) => (touches.AnyObject as UITouch)?.LocationInView(m_uiView); + + public void NotifyLongPress() + { + m_longPressDetected = true; + } protected override void Dispose(bool disposing) { diff --git a/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchPlatformEffect.cs b/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchPlatformEffect.cs index a39eb9f04..a463e64ca 100644 --- a/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchPlatformEffect.cs +++ b/src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchPlatformEffect.cs @@ -41,6 +41,8 @@ private void OnLongPress(UILongPressGestureRecognizer e) if (e.State != UIGestureRecognizerState.Began) return; + m_tapGestureRecognizer?.NotifyLongPress(); + if (Touch.GetLongPressCommand(Element)?.CanExecute(Touch.GetLongPressCommandParameter(Element)) ?? false) Touch.GetLongPressCommand(Element)?.Execute(Touch.GetLongPressCommandParameter(Element)); } From ed5244a999e93a47a4446abc7b05c918425f6b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirin=20Svins=C3=A5s?= Date: Wed, 5 Nov 2025 10:55:09 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa0917ce..74ab2cef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [53.6.1] +## [53.6.2] - [iOS] Fixed so Touch.Command will not be executed when long press is recognized. ## [53.6.1]