File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,26 @@ @implementation DWKWebView
24
24
bool isDebug;
25
25
}
26
26
27
+ -(instancetype )initWithCoder : (NSCoder *)coder
28
+ {
29
+ self = [super initWithCoder: coder];
30
+ if (self) {
31
+ [self commonInit ];
32
+ }
33
+ return self;
34
+ }
27
35
28
36
-(instancetype )initWithFrame : (CGRect)frame configuration : (WKWebViewConfiguration *)configuration
29
37
{
38
+ self = [super initWithFrame: frame configuration: configuration];
39
+ if (self) {
40
+ [self commonInit ];
41
+ }
42
+ return self;
43
+ }
44
+
45
+ -(void )commonInit {
46
+ super.UIDelegate =self;
30
47
txtName=nil ;
31
48
dialogType=0 ;
32
49
callId=0 ;
@@ -46,16 +63,12 @@ -(instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration
46
63
WKUserScript *script = [[WKUserScript alloc ] initWithSource: @" window._dswk=true;"
47
64
injectionTime: WKUserScriptInjectionTimeAtDocumentStart
48
65
forMainFrameOnly: YES ];
49
- [configuration.userContentController addUserScript: script];
50
- self = [super initWithFrame: frame configuration: configuration];
51
- if (self) {
52
- super.UIDelegate =self;
53
- }
66
+ [self .configuration.userContentController addUserScript: script];
67
+
54
68
// add internal Javascript Object
55
69
InternalApis * interalApis= [[InternalApis alloc ] init ];
56
70
interalApis.webview =self;
57
71
[self addJavascriptObject: interalApis namespace: @" _dsb" ];
58
- return self;
59
72
}
60
73
61
74
- (void )webView : (WKWebView *)webView runJavaScriptTextInputPanelWithPrompt : (NSString *)prompt
You can’t perform that action at this time.
0 commit comments