Skip to content
Snippets Groups Projects
Commit cc0a2de2 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Using nav controller to webscreen

parent 665b4ff3
No related branches found
No related tags found
1 merge request!103Fix dismissing webscreen
......@@ -203,9 +203,6 @@ let package = Package(
),
.target(
name: "WebsiteFeature",
dependencies: [
.target(name: "AppResources"),
],
swiftSettings: swiftSettings
),
.target(
......
......@@ -40,7 +40,9 @@ public struct PresentWebsiteNavigator: TypedNavigator {
public func perform(_ action: PresentWebsite, completion: @escaping () -> Void) {
action.parent.present(
viewController(action.urlString),
UINavigationController(
rootViewController: viewController(action.urlString)
),
animated: action.animated,
completion: completion
)
......
import UIKit
import WebKit
import AppResources
public final class WebsiteController: UIViewController {
private lazy var webView = WKWebView()
......@@ -13,26 +12,7 @@ public final class WebsiteController: UIViewController {
}
public override func loadView() {
let screenView = UIView()
let navigationBar = UINavigationBar()
navigationBar.isTranslucent = false
navigationBar.backgroundColor = Asset.neutralLine.color
screenView.addSubview(navigationBar)
screenView.addSubview(webView)
navigationBar.translatesAutoresizingMaskIntoConstraints = false
navigationBar.leftAnchor.constraint(equalTo: screenView.leftAnchor).isActive = true
navigationBar.rightAnchor.constraint(equalTo: screenView.rightAnchor).isActive = true
navigationBar.topAnchor.constraint(equalTo: screenView.safeAreaLayoutGuide.topAnchor).isActive = true
webView.translatesAutoresizingMaskIntoConstraints = false
webView.leftAnchor.constraint(equalTo: screenView.leftAnchor).isActive = true
webView.rightAnchor.constraint(equalTo: screenView.rightAnchor).isActive = true
webView.topAnchor.constraint(equalTo: navigationBar.bottomAnchor).isActive = true
webView.bottomAnchor.constraint(equalTo: screenView.bottomAnchor).isActive = true
view = screenView
view = webView
}
required init?(coder: NSCoder) { nil }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment