Skip to content

Instantly share code, notes, and snippets.

@sbrocket
Created December 24, 2008 04:13
Show Gist options
  • Select an option

  • Save sbrocket/39579 to your computer and use it in GitHub Desktop.

Select an option

Save sbrocket/39579 to your computer and use it in GitHub Desktop.
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch *touch = [touches anyObject];
if (CGPointEqualToPoint([touch previousLocationInView:self], [touch locationInView:self]))
[controller toggleToolbars];
[super touchesEnded:touches withEvent:event];
}
The resulting stack trace, 2nd time around:
#0 0x00009f84 in -[ScreenshotsScrollView touchesEnded:withEvent:] at ScreenshotsScrollView.m:22
#1 0x30adb8e5 in forwardMethod2
#2 0x30a7dc17 in -[UIScrollView touchesEnded:withEvent:]
#3 0x0000a035 in -[ScreenshotsScrollView touchesEnded:withEvent:] at ScreenshotsScrollView.m:25
#4 0x30a6790f in -[UIWindow sendEvent:]
#5 0x30a56ff7 in -[UIApplication sendEvent:]
#6 0x30a561d8 in _UIApplicationHandleEvent
#7 0x31563dea in SendEvent
#8 0x3156640c in PurpleEventTimerCallBack
#9 0x95581615 in CFRunLoopRunSpecific
#10 0x95581cf8 in CFRunLoopRunInMode
#11 0x31564600 in GSEventRunModal
#12 0x315646c5 in GSEventRun
#13 0x30a4ec98 in -[UIApplication _run]
#14 0x30a5a094 in UIApplicationMain
#15 0x00002606 in main at main.m:10
And the hacky fix:
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
if (!inTouchesEnded) {
inTouchesEnded = YES;
UITouch *touch = [touches anyObject];
if (CGPointEqualToPoint([touch previousLocationInView:self], [touch locationInView:self]))
[controller toggleToolbars];
[super touchesEnded:touches withEvent:event];
inTouchesEnded = NO;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment