Remove tab bar controller from view controller - swift

I have a view controller which is connected my tab bar controller. This view controller also has a segue connection to a pop up view controller. As shown in the image below.
The problem is having is that the tab bar is being placed at the front of my pop up view controller like below.
I don't want this to be clickable since some weird behaviour happens when you press an item on the tab bar. So is there a way to send this to the back or hide this tab bar controller?
It's worth noting that in the class for this view controller there isn't an IBOutlet for this tab bar controller so i'm not able to access it in this view.

Removing a tab bar controller from a view controller where a pop-up or alert is only partially covering the background (or parent) view controller could be confusing or wierd looking to the user.
If you have access to your tab bar controller via an IBOutlet, you could disable touches to it by setting .userInteractionEnabled to false and setting the alpha of it to 0.7 or 0.6, giving an impression that it's temporarily disabled while the pop up is appearing.
If you don't have access to your tab bar controller (I just noticed that comment in the last sentences of your question), you could also register a notification observer in the class that does hold the tab bar controller outlet and you can send custom events (that you define) like "popupViewAppeared" and "popupViewDisappeared" to enable/disable the tab bar controller.

Related

How to add the default back button in the navigation view controller from storyboard or in swift?

Okay so I have one main view controller and then I added a navigation view controller from the 'Editor -> Embed In -> Navigation Controller' toolbar and then I segued from the first view controller button to the empty navigation controller scene because if I segued directly to the signup or signin VC the main view controller would end up having a bar on the top like the navigation view controller. But now i added an bar button item "Back" and segued to the main VC and the bar comes back with a builtin back button. So how can i add a default back button or any back button without having the main VC becoming a navigation view controller. Here is a link to an image: https://www.dropbox.com/s/1623a45v846ijn8/Screen%20Shot%202015-09-27%20at%2012.23.26%20PM.png?dl=0
The problem is that you have two navigation controllers when you should only have one.
You should make your initial view controller a UINavigationController, and set your previous initial view controller as the root. If you don't want to see the bar, just set the bar to be hidden on your viewWillAppear, and unhide it on the Sign In / Sign Up pages.

Tab bar disappears after touching cell in tableview

I have an issue with a tab bar app. I am making a tab bar app with three bars on the bottom. On my my first bar it is a tableviewcontroller. When i ckick on the table view controller it takes me to a different view (which doesn't have the tab bar). When I clicked back to the home screen (which has the tab) the tab bar is gone.If you need a picture i will post it!
You may have set your UITableViewController segue to a modal style. If this is the case, you should change it to a push style.
In order for a push to work, your view controller needs to be in a UINavigationController. In your story board, select your root view controller and embed it into a Navigation Controller like this...

Associate tab bar item with navigation controller that displays the second view controller in it's stack?

I'm creating a Tab based application. One of the tab buttons displays a navigation controller when pressed. Which in turn displays the default root view controller associated with that navigation controller.
I want to allow the user to go backwards past the default controller that is displayed when clicking that tab bar button. Conceptually the "main" controller that is displayed when the user clicks the tab bar button would be the second controller in the navigation stack.
The reason I'm doing this is that the "back" controller is to be a kind of setting screen. Changing the setting would effectively make the "main" controller invalid and would need to be recreated. I know I could do settings screen as a modal view controller but when the modal controller is to be dismissed after the setting has been changed I would have to destroy the "main controller behind and rebuild it.
So my idea is to just pop the "main" controller off the stack to the settings screen and then once they have chosen the setting push a new instance of the "main" view controller onto the stack.
My two ideas were to implement this are:
Set the navigation controllers root controller to my "back" controller and push the "main" view controller on top. Then somehow override the tab bar button so that it always displays the second controller first, which exposes the back button in the navigation bar.
The other idea is to set the "main" view controller as the navigation controllers root , and then add a custom back button to the navigation bar which when clicked would somehow insert the "back" controller before the current one and then pop to it when clicked.
I've not been successfully with either of these approaches. I've seen over apps do this mainly Twitter apps where you can go back past the default controller that is loaded when clicking the tab bar item.
Anyone know how to do this? I would prefer to go down the tab bar button triggers the second controller in the navigation stack to be loaded by default.
If this is the apporoach you want to take, you could set yourself as the tabcontroller delegate and implement the method:
-tabBarController:didSelectViewController:
Here you can check if the selected controller is your navigation controller and then pop to the viewController you want.

Navigation Bar in Interface Builder Back Button Issues

I'm not sure what's happening with my Navigation Controller. I have a window with a Tab Bar Controller and 3 Navigation Controllers, they work fine when switching between the views they're set to.
However one View Controller has a Button in the View that pushes another View Controller onto the Navigation Controller, only the back button doesn't come up. I've made a screen that pops a copy of itself to the View Stack and when there are 3 or more Views on the stack, the back button shows up, until it gets to that second view again, and it disappears. Has anyone run into this problem before?

Add view controller over tab bar based application with navigation controller?

I want to add a view controller over navigation view controller in a tab bar application which covers the full screen.
I have crated a view controller (enterPin) and added over the current navigationview controller in a tab bar application.
[self.view addSubview: enterPin.view];
but bottom bar, navigation controller and status bar is not hidding and comes over enterPin view controller. If we hide bottom bar, navigationcontroller and status bar it give white screen at back.
I want the view controller (enterPin) should appear over the navigationview controller (self.view).
Use modal view controller: Tutorial and documentation. Does exactly what you are asking for.
This is very normal behavior. 95% of the time the developer would not want the UINavigationBar to be covered by another view. You have a few options.
Use a modal view controller to prevent the user form interacting with other controls.
Animate the UINavigationBar out or disable it in some way.
Consider making the "Enter PIN" screen something the user sees when they first launch the application.