diff --git a/Sources/Views/InstagramLoginViewController.swift b/Sources/Views/InstagramLoginViewController.swift index 12ef299..9ef4448 100755 --- a/Sources/Views/InstagramLoginViewController.swift +++ b/Sources/Views/InstagramLoginViewController.swift @@ -87,12 +87,20 @@ class InstagramLoginViewController: UIViewController { webConfiguration.websiteDataStore = .nonPersistent() let webView = WKWebView(frame: view.frame, configuration: webConfiguration) - webView.autoresizingMask = [.flexibleWidth, .flexibleHeight] webView.navigationDelegate = self webViewObservation = webView.observe(\.estimatedProgress, changeHandler: progressViewChangeHandler) view.addSubview(webView) + webView.translatesAutoresizingMaskIntoConstraints = false + var topAnchor = view.topAnchor + if #available(iOS 11.0, *) { + topAnchor = view.safeAreaLayoutGuide.topAnchor + } + webView.topAnchor.constraint(equalTo: topAnchor).isActive = true + webView.heightAnchor.constraint(equalTo: view.heightAnchor).isActive = true + webView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + webView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true return webView }