Manos Chorianopoulos

fix button and nav title font size

......@@ -74,7 +74,6 @@ import SwiftEventBus
let htmlDescrText = couponset?.description ?? ""
descriptionLabel.text = htmlDescrText.htmlToString
redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
redeemButton.setTitle("Απόκτησέ το", for: .normal)
redeemButton.setTitleColor(.white, for: .normal)
redeemButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
......@@ -82,9 +81,11 @@ import SwiftEventBus
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 19)
redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
......
......@@ -104,11 +104,23 @@ extension UIViewController {
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)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
if (fontWeight == "bold") {
titleLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 20)
} else {
titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 20)
}
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
if (fontWeight == "bold") {
titleLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 17)
} else {
titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 17)
}
}
titleLabel.adjustsFontSizeToFitWidth = true
titleLabel.textAlignment = .center
self.navigationItem.titleView = titleLabel
......