This repository was archived by the owner on Sep 25, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ open class VisitableView: UIView {
3232 self . visitable = visitable
3333 addSubview ( webView)
3434 addFillConstraints ( forView: webView)
35- updateContentInsets ( )
3635 installRefreshControl ( )
3736 showOrHideWebView ( )
3837 }
@@ -199,7 +198,11 @@ open class VisitableView: UIView {
199198 }
200199
201200 private func updateContentInsets( ) {
202- updateWebViewScrollViewInsets ( contentInset ?? hiddenScrollView. contentInset)
201+ if #available( iOS 11 , * ) {
202+ updateWebViewScrollViewInsets ( contentInset ?? hiddenScrollView. adjustedContentInset)
203+ } else {
204+ updateWebViewScrollViewInsets ( contentInset ?? hiddenScrollView. contentInset)
205+ }
203206 }
204207
205208 private func addFillConstraints( forView view: UIView ) {
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ class WebView: WKWebView {
3636
3737 translatesAutoresizingMaskIntoConstraints = false
3838 scrollView. decelerationRate = UIScrollViewDecelerationRateNormal
39+
40+ if #available( iOS 11 , * ) {
41+ scrollView. contentInsetAdjustmentBehavior = . never
42+ }
3943 }
4044
4145 required init ? ( coder: NSCoder ) {
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ class ApplicationController: UINavigationController {
2626
2727 override func viewDidLoad( ) {
2828 super. viewDidLoad ( )
29+
30+ // Switching this to false will prevent content from sitting beneath scrollbar
31+ navigationBar. isTranslucent = true
32+
2933 presentVisitableForSession ( session, url: url)
3034 }
3135
You can’t perform that action at this time.
0 commit comments