avoiding viewDidAppear

I have a series of table view controllers that each connect to a common detail view controller. In the detail view controller, I include a viewWillAppear function that issues

self.navigationController?.setNavigationBarHidden(true, animated: animated)

This gives me the whole page for my detail view, except for a tab bar controller at the bottom that permits the user to return to one of the table view controllers. I issue the same command with false instead of true in viewWillDisappear to ensure that the navigationBar is visible when I return to the table views.


This works fine. All of the table view controllers have a navigationBar that includes a searchBar. But one of the table view controllers also has a scope bar that appears when the search bar is clicked. The search bar moves to the top of the screen and the scope bar appears beneath. I am following the instructions in a tutorial I found online, and it seems to work fine, except that there must be something I am missing involving a reset as part of the segue. The reason I say that is that when I connect from a table for a selected row chosen with the scope bar shown, the detail view screen that appears ignores the setNavigationBarHidden request in viewWIllAppear and I get some blank screen at the top. A lot of blank screen.


I can fix this by adding the setNavigationBarHidden request in viewDidAppear, but that's a bit clunky as the blank navigation bar appears before disappearing. I am assuming that the demise of the scope bar is associated with a viewWillDisappear or some such that overrides the viewWillAppear on the next screen, but I cannot figure out where and would appreciate suggestions. This is my first question to the forum, and I apologize in advance for any naivete.

You speak of detail view screen.


Does that mean you're in a SplitViewController ?

Nope. Just a standard table view with rows indication (in my case) individual plants. Click on a row and I pass the details for that plant to a larger screen where I show a photo along with a set of buttons to expose plant details, a description, and another photo as a closeup. That's just an ordinary UIViewController.

> All of the table view controllers have a navigationBar that includes a searchBar. But one of the table view controllers also has a scope bar that appears when the search bar is clicked.


You might want to look thru the Human Interface Guidelines to see if there is a better UI design flow...perhaps a tabbar VC or SVC instead of redundant tableviews, search, etc.


Treat that clunky feel as a hint...


And remember, native search is just a sort.

avoiding viewDidAppear
 
 
Q