Refactor PasswordSetupUI, PassportUI, GalleryUI and related modules

This commit is contained in:
Peter
2019-08-12 19:18:43 +03:00
parent aa366dee27
commit a49f04203e
311 changed files with 11406 additions and 1899 deletions

View File

@@ -0,0 +1,35 @@
import Foundation
import UIKit
import AsyncDisplayKit
import Display
import WebKit
final class WebControllerNode: ViewControllerTracingNode {
private let webView: WKWebView
init(url: URL) {
let configuration = WKWebViewConfiguration()
self.webView = WKWebView(frame: CGRect(), configuration: configuration)
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
self.webView.allowsLinkPreview = false
}
self.webView.allowsBackForwardNavigationGestures = true
//webView.navigationDelegate = self
super.init()
self.view.addSubview(self.webView)
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
self.webView.scrollView.contentInsetAdjustmentBehavior = .never
}
self.webView.scrollView.contentInset = UIEdgeInsets(top: 0.0, left: 10.0, bottom: 0.0, right: 10.0)
self.webView.load(URLRequest(url: url))
}
func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
transition.animateView {
self.webView.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: layout.size.width, height: max(1.0, layout.size.height)))
}
}
}