|
|
|
|
109
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
109
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
110
|
UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior;
|
110
|
UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior;
|
111
|
#endif
|
111
|
#endif
|
|
|
112
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
113
|
+ BOOL _savedAutomaticallyAdjustsScrollIndicatorInsets;
|
|
|
114
|
+#endif
|
112
|
}
|
115
|
}
|
113
|
|
116
|
|
114
|
- (instancetype)initWithFrame:(CGRect)frame
|
117
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
|
|
|
140
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
143
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
141
|
_savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
144
|
_savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
142
|
#endif
|
145
|
#endif
|
|
|
146
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
147
|
+ _savedAutomaticallyAdjustsScrollIndicatorInsets = NO;
|
|
|
148
|
+#endif
|
|
|
149
|
+
|
143
|
}
|
150
|
}
|
144
|
|
151
|
|
145
|
#if !TARGET_OS_OSX
|
152
|
#if !TARGET_OS_OSX
|
|
|
|
|
299
|
_webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
|
306
|
_webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
|
300
|
}
|
307
|
}
|
301
|
#endif
|
308
|
#endif
|
|
|
309
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
310
|
+ _webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = _savedAutomaticallyAdjustsScrollIndicatorInsets;
|
|
|
311
|
+#endif
|
302
|
|
312
|
|
303
|
[self addSubview:_webView];
|
313
|
[self addSubview:_webView];
|
304
|
[self setHideKeyboardAccessoryView: _savedHideKeyboardAccessoryView];
|
314
|
[self setHideKeyboardAccessoryView: _savedHideKeyboardAccessoryView];
|
|
|
|
|
445
|
}
|
455
|
}
|
446
|
}
|
456
|
}
|
447
|
#endif
|
457
|
#endif
|
448
|
-
|
|
|
|
|
458
|
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
|
459
|
+- (void)setAutomaticallyAdjustsScrollIndicatorInsets:(BOOL)automaticallyAdjustsScrollIndicatorInsets{
|
|
|
460
|
+ _savedAutomaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
|
|
|
461
|
+ if (_webView == nil) {
|
|
|
462
|
+ return;
|
|
|
463
|
+ }
|
|
|
464
|
+ if ([_webView.scrollView respondsToSelector:@selector(setAutomaticallyAdjustsScrollIndicatorInsets:)]) {
|
|
|
465
|
+ _webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
|
|
|
466
|
+ }
|
|
|
467
|
+}
|
|
|
468
|
+#endif
|
449
|
/**
|
469
|
/**
|
450
|
* This method is called whenever JavaScript running within the web view calls:
|
470
|
* This method is called whenever JavaScript running within the web view calls:
|
451
|
* - window.webkit.messageHandlers[MessageHandlerName].postMessage
|
471
|
* - window.webkit.messageHandlers[MessageHandlerName].postMessage
|