Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit f2b8a2b

Browse files
Update UIGestureRecognizer state machine so UIKit can properly handle… (#1954)
1 parent 204bbe2 commit f2b8a2b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/Touch/PlatformTouchEffect.ios.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public override void TouchesBegan(NSSet touches, UIEvent evt)
137137

138138
HandleTouch(TouchStatus.Started, TouchInteractionStatus.Started).SafeFireAndForget();
139139

140+
State = UIGestureRecognizerState.Began;
140141
base.TouchesBegan(touches, evt);
141142
}
142143

@@ -149,6 +150,7 @@ public override void TouchesEnded(NSSet touches, UIEvent evt)
149150

150151
IsCanceled = true;
151152

153+
State = UIGestureRecognizerState.Ended;
152154
base.TouchesEnded(touches, evt);
153155
}
154156

@@ -161,6 +163,7 @@ public override void TouchesCancelled(NSSet touches, UIEvent evt)
161163

162164
IsCanceled = true;
163165

166+
State = UIGestureRecognizerState.Cancelled;
164167
base.TouchesCancelled(touches, evt);
165168
}
166169

@@ -180,6 +183,7 @@ public override void TouchesMoved(NSSet touches, UIEvent evt)
180183
{
181184
HandleTouch(TouchStatus.Canceled, TouchInteractionStatus.Completed).SafeFireAndForget();
182185
IsCanceled = true;
186+
State = UIGestureRecognizerState.Cancelled;
183187
base.TouchesMoved(touches, evt);
184188
return;
185189
}
@@ -195,6 +199,7 @@ public override void TouchesMoved(NSSet touches, UIEvent evt)
195199
if (status == TouchStatus.Canceled)
196200
IsCanceled = true;
197201

202+
State = UIGestureRecognizerState.Changed;
198203
base.TouchesMoved(touches, evt);
199204
}
200205

0 commit comments

Comments
 (0)