-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIControl+HLSExclusiveTouch.h
31 lines (27 loc) · 1.22 KB
/
UIControl+HLSExclusiveTouch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
// UIControl+HLSExclusiveTouch.h
// nut-dev
//
// Created by Samuel Défago on 07.06.11.
// Copyright 2011 Hortis. All rights reserved.
//
/**
* Simply call this macro somewhere in global scope to enable the UIControl injection early, disabling quasi-
* simultaneous taps. Good places are for example main.m or your application delegate .m file
*/
#define HLSEnableUIControlExclusiveTouch() \
__attribute__ ((constructor)) void HLSEnableUIControlExclusiveTouchConstructor(void) \
{ \
[UIControl injectExclusiveTouch]; \
}
/**
* Globally sets exclusiveTouch for all UIControl objects, preventing quasi-simultaneous taps.
* Will be the default for UIControl starting with iOS 5
*/
@interface UIControl (HLSExclusiveTouch)
/**
* Call this method as soon as possible if you want to disable quasi-simultaneous taps for your whole application. For
* simplicity you should use the HLSEnableUIControlInjection convenience macro instead
*/
+ (void)injectExclusiveTouch;
@end