I have a segue connecting two views. In the parent view, the navigation bar is a gray color, and in the child view, it's clear. When unwinding the segue, the navigation bar in the parent controller is now clear as well. How to fix this?
Parent Controller
override func viewWillAppear(animated: Bool) {
self.navigationItem.title = "FEED"
self.navigationController?.navigationBar.barTintColor = UIColor(white:0.97, alpha:1.0)
let navBarLineView = UIView(frame: CGRectMake(0,
CGRectGetHeight((navigationController?.navigationBar.frame)!),
CGRectGetWidth((self.navigationController?.navigationBar.frame)!),
1))
navBarLineView.backgroundColor = UIColor(red:0.91, green:0.91, blue:0.92, alpha:1.0)
navigationController?.navigationBar.addSubview(navBarLineView)
}
Child Controller
override func viewWillAppear(animated: Bool) {
self.navigationItem.title = "Space
self.navigationController?.navigationBar.barTintColor = UIColor.whiteColor()
navigationController!.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
navigationController!.navigationBar.shadowImage = UIImage()
navigationController!.navigationBar.translucent = true
}