remy boys remy boys - 1 year ago 68
Objective-C Question

get back the default Navigation bar after making it Transparent

i'm making my navigation bar transparent like this :

override func viewWillAppear(animated: Bool) {

self.navigationController!.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
self.navigationController!.navigationBar.shadowImage = UIImage()
self.navigationController!.navigationBar.translucent = true
self.navigationController!.view.backgroundColor = UIColor.clearColor()


but its affecting the other view controller's Navigation bar too so for that i want to make it back as default when the current view disappears , how can i do that ??
i know that i have to do it in
but no idea what to do there

any guidance will be much appreciated

Answer Source

well i ended up with this , on my other viewController where i wanna show my navigationBar

    override func viewDidAppear(animated: Bool) {

    self.navigationController?.navigationBar.translucent = true
    self.navigationController?.navigationBar.barStyle = .Default
    self.navigationController?.navigationBar.backgroundColor = .None
    self.navigationController?.navigationBar.setBackgroundImage(.None, forBarMetrics: .Default)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download