forked from illusionspaces/WKJavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSHRMBasePlugin.m
More file actions
58 lines (41 loc) · 1.19 KB
/
Copy pathSHRMBasePlugin.m
File metadata and controls
58 lines (41 loc) · 1.19 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// SHRMBasePlugin.m
// Hybrid-framework
//
// Created by Kevin on 2019/4/20.
// Copyright © 2019 王凯. All rights reserved.
//
#import "SHRMBasePlugin.h"
#import "SHRMWebViewEngine.h"
@interface SHRMBasePlugin ()
@property (nonatomic, weak) SHRMWebViewEngine *webViewEngine;
@end
@implementation SHRMBasePlugin
- (instancetype)initWithWebViewEngine:(SHRMWebViewEngine *)webViewEngine {
if (self = [super init]) {
_webViewEngine = webViewEngine;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
}
return self;
}
- (UIViewController *)rootViewController {
if (_webViewEngine != nil) {
return self.webViewEngine.webViewDelegate;
}
return nil;
}
- (void)pluginInitialize {
}
- (void)onAppTerminate {
}
- (void)onMemoryWarning {
}
- (void)onReset {
}
- (void)dispose {
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@end