Latest 1.0.1
Homepage https://github.com/inamiy/YIDetectWindow
License Beerware If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.
Platforms ios 4.3, requires ARC
Authors

YIDetectWindow 1.0.1

A subclass of UIWindow for detecting shake, status-bar-tap, long-press, touchBegan/Moved/Ended/Cancelled, via NSNotification.

Install via CocoaPods

pod 'YIDetectWindow'

How to use

- (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;
}

Notifications

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;

License

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.

Latest podspec

{
    "name": "YIDetectWindow",
    "version": "1.0.1",
    "license": {
        "type": "Beerware",
        "text": "If we meet some day, and you think this stuff is worth it, you can buy me a beer in return."
    },
    "homepage": "https://github.com/inamiy/YIDetectWindow",
    "authors": {
        "Yasuhiro Inami": "[email protected]"
    },
    "summary": "A subclass of UIWindow for detecting shake, status-bar-tap, long-press, touchBegan/Moved/Ended/Cancelled, via NSNotification.",
    "source": {
        "git": "https://github.com/inamiy/YIDetectWindow.git",
        "tag": "1.0.1"
    },
    "source_files": "Classes/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "4.3"
    }
}

Pin It on Pinterest

Share This