TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Custom |
ReleasedLast Release | Dec 2014 |
Maintained by Yasuhiro Inami.
A subclass of UIWindow for detecting shake, status-bar-tap, long-press, touchBegan/Moved/Ended/Cancelled, via NSNotification.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIViewController* rootViewController = self.window.rootViewController;
// replace UIWindow with YIDetectWindow
YIDetectWindow* window = [[YIDetectWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.detectsShake = YES;
window.detectsStatusBarTap = YES;
window.detectsTouchPhases = YES;
window.detectsLongPress = YES;
self.window = window;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
extern NSString* const YIDetectWindowDidReceiveShakeNotification;
extern NSString* const YIDetectWindowDidReceiveStatusBarTapNotification;
extern NSString* const YIDetectWindowDidReceiveTouchesBeganNotification;
extern NSString* const YIDetectWindowDidReceiveTouchesMovedNotification;
extern NSString* const YIDetectWindowDidReceiveTouchesEndedNotification;
extern NSString* const YIDetectWindowDidReceiveTouchesCancelledNotification;
extern NSString* const YIDetectWindowDidReceiveLongPressNotification;
YIDetectWindow
is available under the Beerware license.
If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.