@@ -43,11 +43,6 @@ - (void)createWebViewWithURL:(NSURL *)url
43
43
NSURLRequest *request = [NSURLRequest requestWithURL: url];
44
44
[webView loadRequest: request];
45
45
46
- #if (TARGET_OS_IOS)
47
- [NSNotificationCenter .defaultCenter addObserver: self selector: @selector (handleScreenChange ) name: UIDeviceOrientationDidChangeNotification object: nil ];
48
- [NSNotificationCenter .defaultCenter addObserver: self selector: @selector (handleScreenChange ) name: UIScreenModeDidChangeNotification object: nil ];
49
- #endif
50
-
51
46
CLYButton *dismissButton = [CLYButton dismissAlertButton: @" X" ];
52
47
[self configureDismissButton: dismissButton forWebView: webView];
53
48
@@ -64,35 +59,6 @@ - (void)createWebViewWithURL:(NSURL *)url
64
59
}];
65
60
}
66
61
67
- - (void )handleScreenChange {
68
- CGRect screenBounds = [UIScreen mainScreen ].bounds ;
69
- if (@available (iOS 11.0 , *)) {
70
- CGFloat top = UIApplication.sharedApplication .keyWindow .safeAreaInsets .top ;
71
-
72
- if (top) {
73
- screenBounds.origin .y += top + 5 ;
74
- screenBounds.size .height -= top + 5 ;
75
- } else {
76
- screenBounds.origin .y += 20.0 ;
77
- screenBounds.size .height -= 20.0 ;
78
- }
79
- } else {
80
- screenBounds.origin .y += 20.0 ;
81
- screenBounds.size .height -= 20.0 ;
82
- }
83
-
84
- CGFloat width = screenBounds.size .width ;
85
- CGFloat height = screenBounds.size .height ;
86
-
87
- NSString *postMessage = [NSString stringWithFormat:
88
- @" javascript:window.postMessage({type: 'resize', width: %f , height: %f }, '*');" ,
89
- width,
90
- height];
91
- NSURL *uri = [NSURL URLWithString: postMessage];
92
- NSURLRequest *request = [NSURLRequest requestWithURL: uri];
93
- [self .backgroundView.webView loadRequest: request];
94
- }
95
-
96
62
- (void )configureWebView : (WKWebView *)webView {
97
63
webView.layer .shadowColor = UIColor.blackColor .CGColor ;
98
64
webView.layer .shadowOpacity = 0.5 ;
@@ -332,10 +298,6 @@ - (void)resizeWebViewWithJSONString:(NSString *)jsonString {
332
298
}
333
299
334
300
- (void )closeWebView {
335
- #if (TARGET_OS_IOS)
336
- [[NSNotificationCenter defaultCenter ] removeObserver: self name: UIDeviceOrientationDidChangeNotification object: nil ];
337
- [[NSNotificationCenter defaultCenter ] removeObserver: self name: UIScreenModeDidChangeNotification object: nil ];
338
- #endif
339
301
dispatch_async (dispatch_get_main_queue (), ^{
340
302
if (self.dismissBlock ) {
341
303
self.dismissBlock ();
0 commit comments