mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-13 09:50:17 +00:00
Fixed behavior of ASControlNode when -touchesEnded:withEvent: sometimes firing twice.
This commit is contained in:
parent
516e1f177d
commit
dbe068c970
@ -170,6 +170,14 @@ void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, v
|
|||||||
if (!self.enabled)
|
if (!self.enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// On iPhone 6s, iOS 9.2 (and maybe other versions) sometimes calls -touchesEnded:withEvent:
|
||||||
|
// twice on the view for one call to -touchesBegan:withEvent:. On ASControlNode, it used to
|
||||||
|
// trigger an action twice unintentionally. Now, we ignore that event if we're not in a tracking
|
||||||
|
// state in order to have a correct behavior.
|
||||||
|
// It might be related to that issue: http://www.openradar.me/22910171
|
||||||
|
if (!self.tracking)
|
||||||
|
return;
|
||||||
|
|
||||||
NSParameterAssert([touches count] == 1);
|
NSParameterAssert([touches count] == 1);
|
||||||
UITouch *theTouch = [touches anyObject];
|
UITouch *theTouch = [touches anyObject];
|
||||||
CGPoint touchLocation = [theTouch locationInView:self.view];
|
CGPoint touchLocation = [theTouch locationInView:self.view];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user