Manos Chorianopoulos

fix header title fontsize

......@@ -33,7 +33,7 @@ import SwiftEventBus
}
setBackButton()
setNavigationTitle("GIFTS for YOU")
setNavigationTitle("GIFTS for YOU", "bold")
tableView.delegate = self
tableView.dataSource = self
......
......@@ -22,7 +22,7 @@ import SwiftEventBus
self.hidesBottomBarWhenPushed = true
setBackButton()
setNavigationTitle("MORE for YOU")
setNavigationTitle("MORE for YOU", "bold")
tableView.delegate = self
tableView.dataSource = self
......
......@@ -36,13 +36,17 @@ extension UIViewController {
self.navigationController?.popViewController(animated: true)
}
func setNavigationTitle(_ title: String) {
func setNavigationTitle(_ title: String, _ fontWeight: String? = "medium") {
let uiscreen: CGRect = UIScreen.main.bounds
let titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: uiscreen.width * 0.7, height: uiscreen.height * 0.03))
titleLabel.text = title
titleLabel.textColor = UIColor(red: 0.21, green: 0.32, blue: 0.41, alpha: 1.00)
titleLabel.font = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.medium)
if (fontWeight == "bold") {
titleLabel.font = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.bold)
} else {
titleLabel.font = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.semibold)
}
titleLabel.adjustsFontSizeToFitWidth = true
titleLabel.textAlignment = .center
self.navigationItem.titleView = titleLabel
......