I want to remove that line and shadow type bar in navigation bar
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let stroryboard = UIStoryboard.init(name: "Main", bundle: nil)
let rootVC = stroryboard.instantiateViewController(withIdentifier: "DetailViewController") as! DetailViewController
if let data = arrlist.object(at: indexPath.row) as? NSDictionary{
rootVC.dictData = data
}
self.navigationController?.pushViewController(rootVC, animated: true)
let backImg = UIImage(named: "backArrowWhite")
self.navigationController?.navigationBar.backIndicatorImage = backImg
self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = backImg
self.navigationController?.navigationBar.tintColor = .black
self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: UIBarButtonItem.Style.plain, target: nil, action: nil)
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().backgroundColor = UIColor.clear
UINavigationBar.appearance().isTranslucent = true
}
i did these code to remove it
but it has 0 effect how can i remove ??
2
Answers
i got my answer i just removed apparance lines and changed it to three line wrote it in viweDidLoad()
worked...
For me this worked fine
I have made extension on viewController and called it in viewDidLoad in first controller in navigation stack