Manos Chorianopoulos

Remove navigationBar bottom border new fix

......@@ -79,7 +79,8 @@ extension UIViewController {
}
// Remove navigationBar bottom border
self.navigationController?.navigationBar.hideBottomHairline()
// self.navigationController?.navigationBar.hideBottomHairline()
self.navigationController?.hideHairline()
}
......@@ -460,3 +461,29 @@ extension UIView {
return nil
}
}
extension UINavigationController {
func hideHairline() {
if let hairline = findHairlineImageViewUnder(navigationBar) {
hairline.isHidden = true
}
}
func restoreHairline() {
if let hairline = findHairlineImageViewUnder(navigationBar) {
hairline.isHidden = false
}
}
func findHairlineImageViewUnder(_ view: UIView) -> UIImageView? {
if view is UIImageView && view.bounds.size.height <= 1.0 {
return view as? UIImageView
}
for subview in view.subviews {
if let imageView = self.findHairlineImageViewUnder(subview) {
return imageView
}
}
return nil
}
}
......