I want to set a safety zone by device. My web view is set to SafeArea above
, SuperView below
. After the iPhone X
series, the value of Y
is 44
because of the notch
area. But for the iPhone 6
and iPhone 8
, 44
is too wide. How do I adjust it?
Area of the current WKWebView
Load WebView Area from Current Swift5
@IBOutlet var WKWebView: FullScreenWKWebView!
...
let config = WKWebViewConfiguration()
contentController.add(self, name: "goApp")
config.userContentController = contentController
WKWebView = FullScreenWKWebView(frame: WKWebView.frame, configuration: config)
WKWebView.uiDelegate = self
WKWebView.navigationDelegate = self
WKWebView.scrollView.delegate = self
view.addSubview(WKWebView)
view.addSubview(indicator)
...
class FullScreenWKWebView: WKWebView {
override var safeAreaInsets: UIEdgeInsets {
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}
}
I want to set the Top SafeArea area by device.
I am trying things, but is unsuccessful.