Tab bar/tab item disappears on two of tabs in my app - ios

In my storyboard app, I have a UITabController, which leads to a number of UIViewController.
Two of these primary UIViewController have a series of buttons which lead to secondary UIViewController.
Each of those secondary UIViewController displays html content, and they each have a button to go back to the primary UIViewController and a button to go back to the UITabController.
On the primary UIViewController, the tab bar displays fine with the various items. If I click a button to go to a secondary UIViewController, and then click the button to take me back to the primary UIViewController, I noticed that the UITabBar and items are not appearing.
Is there a setting that I need to change with regards to the tab bar to force it to display on the primary view when returning from the secondary view?
(PS ignore the website that shows in the screenshot of the secondary view, for some reason in the simulator it shows the website, but when I compile and run on an actual device it displays the correct html file that is hosted on the same site).

When you are using modal segue then it is meaning present UIViewController.
Unlike push(show) navigation, present UIViewController can be said overlay it's UIViewController on top of it.
Let's say viewController1 is one of tabViewController item and you are going to present viewcontroller2.
Then you are present viewcontroller1 again on top of viewController2.
This is meaning at the bottom there's viewController1 nested in UITabController and viewController2 on top of it and another viewController1 on top of it again.
That's UIViewController doesn't have tab items and tab bar.
So to go back, you'd rather to use dismiss UIViewController instead of present it again.

Related

Add a right button to a nested view in a UINavigation stacking using Storyboards

Lets say we have a UIViewController embedded in a UINavigationController, the UIViewController segue to another UIViewController.
The second UIViewController has the standard left navigation button that "unwinds" to the previous UIViewController.
I don't seem to be able to add a righthand button (using a UIBarButtonItem) to the navigation bar of the second UIViewController via the Storyboard, when I attempt this the button ends up creating a tab bar at the bottom of the UIViewController (see below, notice also the left buttons are missing). Is there some trick I am missing?
I could embedded the second UIViewController in its own UINavigationController but then I loss the back button functionality.
I know it is possible to add the button in code so all is not lost if I am attempting something that isint possible.
To do this in the Storyboard, you need to place a UINavigationItem onto your UIViewController. Then you can add your UIBarButtonItem(s).

How to go back to UiTabBar home page from UiTableViewController that is loaded upon button click from a button within the homepage tab?

i have created a universal tabbed iOS application in Swift 2.0, the application has 3 tabs in the first tab, in the viewcontroller in storyboard i have placed a button upon which when pressed a UiTableView is loaded and it has a feature to add cell (a note taking feature embedded within the app), my issue is that once the UITableViewController is loaded i cannot go back to the previous page, its like this:
I have a TabBarController linked to a NavigationController which is linked to a HomepageViewController and When button is clicked, NavigationController linked to UITableView which shows ItemDetailViewController
My problem is that once i get to the UITableViewController i cannot go back to the home tab - HomeViewController
I have tried adding a UiBarButton to the top left of the UITableController and using poptorootviewcontroller , but it didnt work, any help will be appreciated.
According to my understanding, your tabbar controller is at the root of window. You can access it as self.window.rootviewcontroller. After that, you can use tabar.selectedIndex to switch tabs.

How to present uiview from tabbar

I am working on a TabBarController base application and my TabBarController has 5 tabs.
When a user clicks on the third tab I want to present a UIView with dimensions of 280*100 and the background shows the selected ViewController.
Just have the 3rd tab reference a 3rd UIViewController that has a UIView with the dimensions you specified. If you are concerned about the nav info, etc. showing in the UIViewContoller, then you can suppress all of that.
If you want to use the tab bar to change the UI appearance of the same UIViewController (e.g. tab1 shows a UIView, tab2 shows a button, etc. all within the same VC) then you are using the wrong control.
See this UITabBarController Class Reference for the role of UITabBarController

Right navigation item disappear when pushes JASidePanels

I am using the JASidePanels as submodule and I wanted to know if there is a way to keep the right icon on the navigation bar always visible and working.
For now I have my center panel which is a table view, and both left and right panels works.
But when I click a table view cell, it pushes a viewcontroller on it but the JASidePanel controls are lost... I cant slide it to the left to see my right panel.
Yes, I know that the left button will be replaced with the back button. This one is fine for me, I just care about the one on the right.
UINavigationController presents UIViewController (and subclasses). Each UIViewController is associated with an UINavigationItem that contains the information about the tool bar items and navigation bar items. This information is only used when that particular view controller is presented in a UINavigationController. If you want to put a button from viewController 1 in viewController 2, you need to assign the button to the UINavigationItem instance of viewController 2. Note that, if the action:target receiver for the button action is not viewController 1, you can easily create the UIBarButtonItem instance with the same characteristics in viewController1 for viewController2's UINavigationItem instance in viewController2's viewDidLoad method.

How to go from a single view to a tab bar view

need some help here
My problem is, my app starts with a single view, it shows a menu made with buttons that takes me to different places, one of this places is another kind of menu, but this menu is a tab bar menu, so the thing is, I made a new file with its .xib, I added the tab bar controller, and i Linked all the sections of my tabs with its viewcontrollers...
this means that I have my first menu ready, I have my view controllers ready, I have my menu on the tab bar ready....
so my problem is...
how can I go from my single view (the first view that I see and that doesnt include a tab bar), to the new screen with tab bar controller in it after pressing a button???
help me please
Note: I'm using XCode 4.2 and I'm not working with storyboards (requirements of the app)
You have three options to show your viewController content :
1.using presentModalViewController:
2.add the viewController view as a subView to the current viewController. in your case : [singleViewController.view addSubView:tabBarViewController.view];
3.or if your simple ViewController is the navigation root viewController you can push other viewControllers to its navigation stack. (as #roronoa zorro described).
You might have added all the next viewControllers on the taBarController so if you have want to tabbar on to next screen you simplr have to push the tabbarcontroller on the navigationcontroller.
[self.navigationController pushViewController:TabBarControllerObj];

Resources