Manos Chorianopoulos

Remove navigationBar bottom border

......@@ -77,6 +77,10 @@ extension UIViewController {
navigationController?.navigationBar.tintColor = UIColor.white
// navigationController?.navigationBar.isTranslucent = false
}
// Remove navigationBar bottom border
self.navigationController?.navigationBar.hideBottomHairline()
}
......@@ -379,3 +383,41 @@ extension UITextField {
self.resignFirstResponder()
}
}
extension UINavigationBar {
func hideBottomHairline() {
self.hairlineImageView?.isHidden = true
}
func showBottomHairline() {
self.hairlineImageView?.isHidden = false
}
}
extension UIToolbar {
func hideBottomHairline() {
self.hairlineImageView?.isHidden = true
}
func showBottomHairline() {
self.hairlineImageView?.isHidden = false
}
}
extension UIView {
fileprivate var hairlineImageView: UIImageView? {
return hairlineImageView(in: self)
}
fileprivate func hairlineImageView(in view: UIView) -> UIImageView? {
if let imageView = view as? UIImageView, imageView.bounds.height <= 1.0 {
return imageView
}
for subview in view.subviews {
if let imageView = self.hairlineImageView(in: subview) { return imageView }
}
return nil
}
}
......