Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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
Expand All @@ -58,7 +58,7 @@ class BoxListView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = ColorPalette.backgroundColor
backgroundColor = .systemBackground

setupLayout()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@

import UIKit

class BoxListViewController: BaseViewController<BoxListView> {
class BoxListViewController: BaseNavigationBarViewController<BoxListView> {

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")
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import WebKit

import SnapKit

class WebView: UIView {
class WebView: BaseView {
var selectedWebsite: String? {
didSet {
loadWebsite()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@

import UIKit

class WebViewController: BaseViewController<WebView> {
class WebViewController: BaseNavigationBarViewController<WebView> {
var selectedWebsite: String?

override func viewDidLoad() {
super.viewDidLoad()
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)
}

}