Created
July 13, 2014 07:08
-
-
Save jontelang/c8a6590d90bee81594f9 to your computer and use it in GitHub Desktop.
asd
This file contains hidden or 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
| // | |
| // Includes | |
| // | |
| #import "/Users/jontelang/Files/Development/Flipswitch/FSSwitchPanel.h" | |
| #import "Activator/libactivator.h" | |
| // | |
| // InstaTogglesWindow interface | |
| // | |
| @interface InstaTogglesWindow : UIWindow <LAListener> | |
| { | |
| BOOL hasBeenBuiltOnce; | |
| } | |
| @end | |
| // | |
| // InstaTogglesWindow implementation | |
| // | |
| @implementation InstaTogglesWindow | |
| -(id)init | |
| { | |
| if( self == [super init] ) | |
| { | |
| hasBeenBuiltOnce = NO; | |
| } | |
| return self; | |
| } | |
| - (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event | |
| { | |
| NSLog(@"InstaToggles event received"); | |
| if( hasBeenBuiltOnce == NO ) | |
| { | |
| [self setFrame:[UIScreen mainScreen].bounds]; | |
| [self setBackgroundColor:[UIColor redColor]]; | |
| [self setWindowLevel:UIWindowLevelStatusBar+55]; | |
| [self makeKeyAndVisible]; | |
| hasBeenBuiltOnce = YES; | |
| } | |
| else | |
| { | |
| [self setHidden:!self.hidden]; | |
| } | |
| NSLog(@"InstaToggles: %@",self); | |
| } | |
| @end | |
| // | |
| // Static instances | |
| // | |
| static InstaTogglesWindow* IT; | |
| // | |
| // Constructor | |
| // | |
| %ctor | |
| { | |
| IT = [[InstaTogglesWindow alloc] init]; | |
| [[LAActivator sharedInstance] registerListener:IT forName:@"com.jontelang.instatoggles"]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment