How to add shadow and remove bottom line in NavigationBar globally?

So I’m looking for how can I add shadow to NavigationBar and remove the bottom black line from NavigationBar? Also if I have searchBar in NavigationBar then shadow should go below to search bar. I want to make a change globally without making a change in every viewController.

So I already archive these changes except add a shadow below to search controller.

  1. For Shadow:

    self.navigationController?.navigationBar.isTranslucent = false self.navigationController?.navigationBar.layer.shadowColor = self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) self.navigationController?.navigationBar.layer.shadowRadius = 7.0 self.navigationController?.navigationBar.layer.shadowOpacity = 0.2 
  2. For Remove a Bottom Bar:

    UINavigationBar.appearance().backIndicatorImage = UIImage(named:"normal") UINavigationBar.appearance().backIndicatorTransitionMaskImage = UIImage(named:"normal") 

This is What issue I’m getting with search Bar

View post on