diff --git a/iBox/Sources/BoxList/Model/Folder.swift b/iBox/Sources/Model/Folder.swift similarity index 100% rename from iBox/Sources/BoxList/Model/Folder.swift rename to iBox/Sources/Model/Folder.swift diff --git a/iBox/Sources/BoxList/BoxListView.swift b/iBox/Sources/Presenter/BoxList/BoxListView.swift similarity index 97% rename from iBox/Sources/BoxList/BoxListView.swift rename to iBox/Sources/Presenter/BoxList/BoxListView.swift index 93d1e45..dd0cf4e 100644 --- a/iBox/Sources/BoxList/BoxListView.swift +++ b/iBox/Sources/Presenter/BoxList/BoxListView.swift @@ -13,7 +13,7 @@ protocol BoxListViewDelegate: AnyObject { func didSelectWeb(at url: String, withName name: String) } -class BoxListView: UIView { +class BoxListView: BaseView { weak var delegate: BoxListViewDelegate? var folderArr = [ @@ -31,7 +31,7 @@ class BoxListView: UIView { let view = UIView() view.clipsToBounds = true view.layer.cornerRadius = 20 - view.backgroundColor = ColorPalette.tableViewBackgroundColor + view.backgroundColor = .systemGroupedBackground view.addSubview(tableView) tableView.snp.makeConstraints { make in @@ -58,7 +58,7 @@ class BoxListView: UIView { override init(frame: CGRect) { super.init(frame: frame) - backgroundColor = ColorPalette.backgroundColor + backgroundColor = .systemBackground setupLayout() } diff --git a/iBox/Sources/BoxList/BoxListViewController.swift b/iBox/Sources/Presenter/BoxList/BoxListViewController.swift similarity index 64% rename from iBox/Sources/BoxList/BoxListViewController.swift rename to iBox/Sources/Presenter/BoxList/BoxListViewController.swift index 35806f8..b42c9fd 100644 --- a/iBox/Sources/BoxList/BoxListViewController.swift +++ b/iBox/Sources/Presenter/BoxList/BoxListViewController.swift @@ -7,14 +7,17 @@ import UIKit -class BoxListViewController: BaseViewController { +class BoxListViewController: BaseNavigationBarViewController { override func viewDidLoad() { super.viewDidLoad() - baseView.delegate = self - title = "iBox" - navigationController?.navigationBar.prefersLargeTitles = true + guard let contentView = contentView as? BoxListView else { return } + contentView.delegate = self + } + + override func setupNavigationBar() { + setNavigationBarTitleLabelText("iBox") } } diff --git a/iBox/Sources/BoxList/FolderButton.swift b/iBox/Sources/Presenter/BoxList/FolderButton.swift similarity index 100% rename from iBox/Sources/BoxList/FolderButton.swift rename to iBox/Sources/Presenter/BoxList/FolderButton.swift diff --git a/iBox/Sources/ColorPalette.swift b/iBox/Sources/Presenter/ColorPalette.swift similarity index 83% rename from iBox/Sources/ColorPalette.swift rename to iBox/Sources/Presenter/ColorPalette.swift index da9113b..da77a9b 100644 --- a/iBox/Sources/ColorPalette.swift +++ b/iBox/Sources/Presenter/ColorPalette.swift @@ -32,16 +32,6 @@ enum ColorName: String { struct ColorPalette { - public static var backgroundColor = { - return UIColor { (UITraitCollection: UITraitCollection) -> UIColor in - if UITraitCollection.userInterfaceStyle == .dark { - return .black - } else { - return .systemGray5 - } - } - }() - public static var tableViewBackgroundColor = { return UIColor { (UITraitCollection: UITraitCollection) -> UIColor in if UITraitCollection.userInterfaceStyle == .dark { diff --git a/iBox/Sources/Web/WebView.swift b/iBox/Sources/Presenter/Web/WebView.swift similarity index 97% rename from iBox/Sources/Web/WebView.swift rename to iBox/Sources/Presenter/Web/WebView.swift index bd72e75..919ca98 100644 --- a/iBox/Sources/Web/WebView.swift +++ b/iBox/Sources/Presenter/Web/WebView.swift @@ -10,7 +10,7 @@ import WebKit import SnapKit -class WebView: UIView { +class WebView: BaseView { var selectedWebsite: String? { didSet { loadWebsite() diff --git a/iBox/Sources/Web/WebViewController.swift b/iBox/Sources/Presenter/Web/WebViewController.swift similarity index 52% rename from iBox/Sources/Web/WebViewController.swift rename to iBox/Sources/Presenter/Web/WebViewController.swift index 5b47a29..6e0c75c 100644 --- a/iBox/Sources/Web/WebViewController.swift +++ b/iBox/Sources/Presenter/Web/WebViewController.swift @@ -7,7 +7,7 @@ import UIKit -class WebViewController: BaseViewController { +class WebViewController: BaseNavigationBarViewController { var selectedWebsite: String? override func viewDidLoad() { @@ -15,7 +15,12 @@ class WebViewController: BaseViewController { view.backgroundColor = .systemBackground navigationItem.largeTitleDisplayMode = .never - baseView.selectedWebsite = selectedWebsite + guard let contentView = contentView as? WebView else { return } + contentView.selectedWebsite = selectedWebsite + } + + override func setupNavigationBar() { + setNavigationBarHidden(true) } }