|
|
|
|
67
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
67
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
68
|
UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior;
|
68
|
UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior;
|
69
|
#endif
|
69
|
#endif
|
|
|
70
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
71
|
+ BOOL _savedAutomaticallyAdjustsScrollIndicatorInsets;
|
|
|
72
|
+#endif
|
70
|
}
|
73
|
}
|
71
|
|
74
|
|
72
|
- (instancetype)initWithFrame:(CGRect)frame
|
75
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
|
|
|
87
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
90
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
88
|
_savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
91
|
_savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
89
|
#endif
|
92
|
#endif
|
|
|
93
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
94
|
+ _savedAutomaticallyAdjustsScrollIndicatorInsets = NO;
|
|
|
95
|
+#endif
|
|
|
96
|
+
|
90
|
}
|
97
|
}
|
91
|
|
98
|
|
92
|
if (@available(iOS 12.0, *)) {
|
99
|
if (@available(iOS 12.0, *)) {
|
|
|
|
|
280
|
_webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
|
287
|
_webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
|
281
|
}
|
288
|
}
|
282
|
#endif
|
289
|
#endif
|
|
|
290
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
291
|
+ _webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = _savedAutomaticallyAdjustsScrollIndicatorInsets;
|
|
|
292
|
+#endif
|
283
|
|
293
|
|
284
|
[self addSubview:_webView];
|
294
|
[self addSubview:_webView];
|
285
|
[self setHideKeyboardAccessoryView: _savedHideKeyboardAccessoryView];
|
295
|
[self setHideKeyboardAccessoryView: _savedHideKeyboardAccessoryView];
|
|
|
|
|
396
|
}
|
406
|
}
|
397
|
}
|
407
|
}
|
398
|
#endif
|
408
|
#endif
|
399
|
-
|
|
|
|
|
409
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
410
|
+- (void)setAutomaticallyAdjustsScrollIndicatorInsets:(BOOL)automaticallyAdjustsScrollIndicatorInsets{
|
|
|
411
|
+ _savedAutomaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
|
|
|
412
|
+ if (_webView == nil) {
|
|
|
413
|
+ return;
|
|
|
414
|
+ }
|
|
|
415
|
+ if ([_webView.scrollView respondsToSelector:@selector(setAutomaticallyAdjustsScrollIndicatorInsets:)]) {
|
|
|
416
|
+ _webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
|
|
|
417
|
+ }
|
|
|
418
|
+}
|
|
|
419
|
+#endif
|
400
|
/**
|
420
|
/**
|
401
|
* This method is called whenever JavaScript running within the web view calls:
|
421
|
* This method is called whenever JavaScript running within the web view calls:
|
402
|
* - window.webkit.messageHandlers[MessageHandlerName].postMessage
|
422
|
* - window.webkit.messageHandlers[MessageHandlerName].postMessage
|