-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathABWindow.m
43 lines (34 loc) · 854 Bytes
/
ABWindow.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
#import <UIKit/UIKit.h>
#import "ABWindow.h"
@implementation ABViewController
- (BOOL)shouldAutorotate {
return FALSE;
}
@end
@implementation ABWindow
+ (instancetype)sharedInstance {
static dispatch_once_t p = 0;
__strong static id _sharedSelf = nil;
dispatch_once(&p, ^{
_sharedSelf = [[self alloc] init];
});
return _sharedSelf;
}
- (instancetype)init {
self = [super initWithFrame:[[UIScreen mainScreen] bounds]];
if (self != nil){
[self setHidden:NO];
[self setWindowLevel:UIWindowLevelAlert];
[self setRootViewController:[[ABViewController alloc] init]];
[self setBackgroundColor:[UIColor clearColor]];
[self setUserInteractionEnabled:YES];
}
return self;
}
-(bool)_shouldCreateContextAsSecure {
return 0x0;
}
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
return nil;
}
@end