Created
June 25, 2014 23:17
-
-
Save olivercameron/e74d399c54250d016d62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIApplication+UDCStatusView.m | |
// Udacity | |
// | |
// Created by Oliver Cameron on 12/5/13. | |
// Copyright (c) 2013 Udacity. All rights reserved. | |
// | |
#import "UIApplication+UDCStatusView.h" | |
NSTimeInterval const UDCStatusViewTransitionAnimationDuration = 0.2; | |
@implementation UIApplication (UDCStatusView) | |
- (UIWindow *)udc_statusView { | |
NSString *key = @"_xsxtxaxtxuxsxBxaxrxWxixnxdxoxwx"; | |
NSString *newKey = [key stringByReplacingOccurrencesOfString:@"x" withString:@""]; | |
UIWindow *window = (UIWindow *)[[UIApplication sharedApplication] valueForKey:newKey]; | |
if ([window isKindOfClass:[UIWindow class]]) { | |
return window; | |
} | |
else { | |
return nil; | |
} | |
} | |
+ (void)udc_setStatusViewAlpha:(CGFloat)alpha animated:(BOOL)animated { | |
if (animated) { | |
[UIView animateWithDuration:UDCStatusViewTransitionAnimationDuration | |
animations:^{ | |
[[UIApplication sharedApplication] udc_statusView].alpha = alpha; | |
} completion:nil]; | |
} | |
else { | |
[[UIApplication sharedApplication] udc_statusView].alpha = alpha; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment