-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSLWindow.m
44 lines (37 loc) · 966 Bytes
/
SLWindow.m
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#import "SLWindow.h"
#import "SLViewController.h"
@implementation SLWindow
- (instancetype)init {
self = [super initWithFrame:[[UIScreen mainScreen] bounds]];
if (self != nil){
[self setHidden:NO];
[self setWindowLevel:UIWindowLevelAlert];
[self setBackgroundColor:[UIColor clearColor]];
[self setUserInteractionEnabled:YES];
[self setRootViewController:[SLViewController sharedInstance]];
}
return self;
}
-(void)makeKeyAndVisible {
[super makeKeyAndVisible];
return;
}
- (BOOL)shouldAutorotate {
return FALSE;
}
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *hitTestResult = [super hitTest:point withEvent:event];
if (self.touchInjection == false) {
return nil;
}
return hitTestResult;
}
+ (instancetype)sharedInstance {
static dispatch_once_t p = 0;
__strong static id _sharedSelf = nil;
dispatch_once(&p, ^{
_sharedSelf = [[self alloc] init];
});
return _sharedSelf;
}
@end