NavigationController switching issue - ios

I have a UINavigationController, its root controller (UITableViewController) and an instance of UIViewController that is pushed to the top of Navigation when I click on a cell in Navigation Controller's root view (i.e. table view). The problem comes, when I swipe from a view controller to the root one. The selection doesn't disappear though I send deselectRowAtIndexPath:animated: message in its table view. If I click on the back button it works properly. How do I solve this issue? Thank you in advance!

There is a property of UITableViewController called clearsSelectionOnViewWillAppear.
If you set that to YES (I believe you can access this in IB int eh inspector too) then it will stop this happening.

Related

Back button does not show up in navigation controller

I have added a show segue from table cell in one view controller to another table view embedded in a navigation controller. When I click on the cell in the first view the segue works as expected and brings up the new view. However, the "Back" button (with the title of the original view) does not appear in the navigation bar.
I searched SO and found a number of such questions asked in the past (both for Swift and Objective-C). Most of them suggest that the first view needs a title for this to work. I do have a title. I even added one programmatically, just in case. That did not help. One of the answers suggested to add an identifier to the segue; that didn't help me either.
How else can I debug this issue?
It seems like the problem is that you are pushing into a totally new navigationController, remove it, and make segue dirrectly into the new view Detail itself, they have to be in the same navigationController to work
Verify you are not hiding backbutton in destination controller...
I had a left bar button item in storyboard removing the button, back button showed up.

Destination Controller Showing without Navigation Bar

This is driving me crazy! I am creating a segue from one of the UITableViewCells to another UITableViewController. A Navigation controller sits between them as shown in the screenshot below:
When I reach the Samples UITableViewController it appears without the NavigationBar as shown below:
Am I doing something wrong?
Your first UITableViewController is in a navigation controller too right ?
If not, it's normal, see this post.
If your first UITableViewController is in a navigation controller, I had the same problem, if you use the push segue (deprecated) it should resolve your problem.

Using UITableViewController in a navigation bar

I'm new to iOS, but I know the basis. I want to host 3 UITableViewController in a UITabBarController using the storyboard.
I dragged a UITableViewController from the object list(?) and control dragged creating a seguel. Now the tab shows successfully the table view controller.
The issue is the rows are taking the space of the status bar. So I want a navigation bar(?) there, with a title. Since I'm new to iOS I don't know the following:
Given the fact that UITabBarController is the first controller ever, the hosted UITableViewController should not have a back button, obviously. So is it correct to use a navigation bar to display a title (and possible add/edit buttons)
If so, I tried dragging the Navigation Bar but it doesn't work.
What am I missing or doing wrong?
hope this helps
actually it is done for another answer. but it will be handy to u too
You will want to add in 3 UINavigationControllers. Have each tab in the tab bar controller segue to a different navigation controller. Then set the root view controller for each navigation controller to one of the table view controllers.

Adding toolbar to a ViewController in storyboard

I'm using storyboard to create an iPad app. On the main view I have a toolbar and a bar button item, let's call it "show". Then I have dragged a table view controller into the storyboard. I have also added a subclass of UITableViewController to the files and made the class of the dragged table view controller to be that subclass. And I made a popover segue from the "show" button to the table view controller. It works fine, meaning that when "show" pressed I see the popover showing the correct data that I set in the table view. What I cannot seem to figure out is how to put a toolbar on top of the table view in the popover. I took a step back and used a UIViewController instead of UITableViewController and still cannot add a toolbar by dragging it to the view. Any help will be appreciated.
I ended up putting the TableViewController within a NavigationController and the latter in a PopoverController, all in the code, without using IB. I found this an easier solution to get the toolbar than anything else that might work.

Moving a navigation stack to the more-tab

I have a UINavigationController on some tab of a UITabBar. When I drill down into the navigation controllers tableViews, move it into the more-tab, and then select the entry in the tableview in the more-list, i get the viewController that was visible at the time i left the tab i moved. Clicking on the back-button gets me back to the more-list, with no possibility to get back to the initial root view controller.
It would be perfectly okay for me to have the root view controller appear when i click on the item in the more-list, but i have no idea how to get notified when my viewcontroller is moved, since i am developing a library, and so have no reference to the TabBarController.
One of the ways is to implement tabBarController:willEndCustomizingViewControllers:changed: method in UITabBarViewController delegate. And watch for it. If such thing happend then reset you viewController and navigationViewController. This remove your UINavigationController stack, but application will work correctly.

Resources