Skip to content

Commit

Permalink
refactor(tab): change webView to private
Browse files Browse the repository at this point in the history
  • Loading branch information
nmotod committed Sep 29, 2023
1 parent 43e76c1 commit 072c6cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ extension TabViewController {
func execute(command: TabCommand, sender: Any?) {
switch command {
case .goBack:
webView?.goBack()
goBack(sender)

case .goForward:
webView?.goForward()
goForward(sender)

case .reload:
webView?.reload()
reload(sender)

case .share:
share(sender)
Expand Down
17 changes: 16 additions & 1 deletion Modules/Sources/TabBrowser/Tab/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TabViewController: UIViewController, WKUIDelegate, WKNavigationDelegate, N

private let webViewContainerController = UIViewController()

private(set) var webView: WKWebView?
private var webView: WKWebView?

private var webViewKVObservations: [NSKeyValueObservation] = []

Expand Down Expand Up @@ -268,6 +268,21 @@ class TabViewController: UIViewController, WKUIDelegate, WKNavigationDelegate, N
}
}

<<<<<<< HEAD
=======
func goBack(_ sender: Any?) {
webView?.goBack()
}

func goForward(_ sender: Any?) {
webView?.goForward()
}

func reload(_ sender: Any?) {
webView?.reload()
}

>>>>>>> 4a7ecac (refactor(tab): change webView to private)
// MARK: - Tab lifecycle

private func tabDidSet() {
Expand Down

0 comments on commit 072c6cc

Please sign in to comment.