Showing
1 changed file
with
42 additions
and
0 deletions
... | @@ -77,6 +77,10 @@ extension UIViewController { | ... | @@ -77,6 +77,10 @@ extension UIViewController { |
77 | navigationController?.navigationBar.tintColor = UIColor.white | 77 | navigationController?.navigationBar.tintColor = UIColor.white |
78 | // navigationController?.navigationBar.isTranslucent = false | 78 | // navigationController?.navigationBar.isTranslucent = false |
79 | } | 79 | } |
80 | + | ||
81 | + // Remove navigationBar bottom border | ||
82 | + self.navigationController?.navigationBar.hideBottomHairline() | ||
83 | + | ||
80 | } | 84 | } |
81 | 85 | ||
82 | 86 | ||
... | @@ -379,3 +383,41 @@ extension UITextField { | ... | @@ -379,3 +383,41 @@ extension UITextField { |
379 | self.resignFirstResponder() | 383 | self.resignFirstResponder() |
380 | } | 384 | } |
381 | } | 385 | } |
386 | + | ||
387 | +extension UINavigationBar { | ||
388 | + func hideBottomHairline() { | ||
389 | + self.hairlineImageView?.isHidden = true | ||
390 | + } | ||
391 | + | ||
392 | + func showBottomHairline() { | ||
393 | + self.hairlineImageView?.isHidden = false | ||
394 | + } | ||
395 | +} | ||
396 | + | ||
397 | +extension UIToolbar { | ||
398 | + func hideBottomHairline() { | ||
399 | + self.hairlineImageView?.isHidden = true | ||
400 | + } | ||
401 | + | ||
402 | + func showBottomHairline() { | ||
403 | + self.hairlineImageView?.isHidden = false | ||
404 | + } | ||
405 | +} | ||
406 | + | ||
407 | +extension UIView { | ||
408 | + fileprivate var hairlineImageView: UIImageView? { | ||
409 | + return hairlineImageView(in: self) | ||
410 | + } | ||
411 | + | ||
412 | + fileprivate func hairlineImageView(in view: UIView) -> UIImageView? { | ||
413 | + if let imageView = view as? UIImageView, imageView.bounds.height <= 1.0 { | ||
414 | + return imageView | ||
415 | + } | ||
416 | + | ||
417 | + for subview in view.subviews { | ||
418 | + if let imageView = self.hairlineImageView(in: subview) { return imageView } | ||
419 | + } | ||
420 | + | ||
421 | + return nil | ||
422 | + } | ||
423 | +} | ... | ... |
-
Please register or login to post a comment