Segue without the tab bar - ios

I have a app that has a tab bar at the bottom.
I am trying to segue to a new view controller via a button that has the code:
#IBAction func moveOver(sender: UIButton) {
self.performSegueWithIdentifier("to-image-select", sender: sender)
}
This works and it segues to the new view, but the tab bar is still at the bottom. How do I make the tab bar not at the bottom? Is there some way of doing a segue that doesnt carry with it the tab bar?
EDIT 1
I do not want the tab bar, I would prefer to have a fully clean UI for this new view. I will have a back button that will take the user back to the previous page in the corner. I am looking into what modally segues are right now.

Will you need your tab bar further in your navigation ?
If yes, you might want to play with the hidden bool property to display it or not.
If no, you could set your segue as presentModally instead of a regular push.
Hope this helps, don't hesitate to provide more information about what your are trying to achieve

You do not have to use tabbar, you can use navigation controller, or present on top. I advise you to try a tutorial about storyboard before jumping in:
https://www.raywenderlich.com/113388/storyboards-tutorial-in-ios-9-part-1
Good luck (:

Related

Back button in the Detail view

I'm struggling with "Master-Detail" concept and almost everything works as expected except one little(but important) nuance. What should I change on the storyboard to have Back button on Detail view(the right corner at the bottom on the screenshot)?
Thanks in advance.
This is an older question, but I just ran into the same thing. The issue is you do not need the navigation controller at the bottom right. Since that is a new navigation controller it will not have a back button, because it only contains one item in its stack.
Remove the bottom right navigation controller and just segue directly to the view controller and that will do it.
Additional tip... to remove the navigation controller and preserve the view, delete the link from the navigation controller to the view, and delete the segue links to the navigation controller. Then recreate the segues directly to your view controller.
So far don't get anything straight. If you want like just below screen then you have to hide your navigationItem backbutton in viewDidLoad like this
navigationItem.hidesBackButton = true
Then in storyboard you have add a toolbar and set it's item title 'Back'. You can also set image for it.
Then drag an action from this item and write this line inside that action
#IBAction func fbfdb(_ sender: Any) {
self.navigationController?.popViewController(animated: true)
}
You may get an warning but you will get your desire action
Storyboard

TabBar disappear after Push Segue

This is the current layout for my application. As you can see, I have a ViewController that is embedded in a TabBarViewController. You can see I have two tab bars in both of those bottom view controllers but only the first one shows up. In the second view controller after the push segue, the tab bar disappears. Why is this?
I added the properties for the First view controller and it is not set to hide the bottom bar during the segue so I am confused as to why it would disappear after the segue. Any ideas?
You'll need to wrap your tabBar's root viewControllers in a UINavigationController. So your UITabBarController would actually be pointed at the Navigation Controller. Then as you move around in that navigation controller, the tab bar will stay in place.
To fix this in your application, select your view controller in storyboard, then click "Editor" -> "Embed In" -> "Navigation Controller".
Here's a visual representation I just threw together for anyone else who comes across this problem. If you remove the "NavigationController" in the storyboard shown below, the tab will disappear when you click the button in "First View". With the navigation controller, you will maintain the tab bar. Hope this helps.
Try set self.tabBarController.tabBar.translucent = NO; in viewWillAppear
You could also try to dismiss the views by adding an outlet/action. For example, I experienced an issue where I had a TabBar view controller and needed to segue between 2 different views (ImageViews) on one of the tabs and as soon as I did a traditional segue, the whole tab bar disappeared. I had created the following "Back button" to clear the view:
#IBAction func backBtnPressed(_ sender: AnyObject) {
dismiss(animated: true, completion: nil)
}
Note: It is an important practice to clear views out as they will stack up overtime and will reduce the performance of your app.
Technical Info:
https://developer.apple.com/reference/uikit/uiviewcontroller/1621505-dismiss
Not sure if this helps but worth mentioning!

Swift/XCode 6.4: add back button to navigation controller in navigation bar

In my app I have this storyboard:
and I would like to add a back button from the second table view back to the first. So I inserted a Navigation controller in order to have a navigation bar in the second table view ad I have created a segue with its identifier from the second table view to the first. But then how can I add a back button? I have tried to drag a button from the library into the navigation controller but it won't let me do it...I had already done this but in this moment I can't remember how.
Please can you help me?
In above image you shared you are making your tableview controller as root view controller.You have to kept your navigation controller on root. As you can see in attached image and you don't have to make back button manually as navigation controller has its own default back button.
This example is right how to make storyboard.Try it
self.navigationController?.navigationBar.hidden = false
In setting of UINavigationController set up like on screenshot
If you're using a navigation controller and its default navigation bar, you don't add an explicit back button--the navigation bar does it for you. You can add a UINavigationItem to your view controller, on which you set a title, back button title, etc.

How to manually add a Back button to my NavigationBar?

I would like to know how I can add a back button to my UINavigationBar, I know that If I embed in a Navigation Controller in my main view, that all of this would happen automatically, but that is not what I am trying to do, in fact, the back button could go to any other view I connect the segue to, doesn't even have to be the back.
The back button needs to be the system navigation "back" button, I don't want to have to set image files for my buttons.
I tried dragging in a bar button item in storyboard but nothing shows up, doesn't seem to be doing the trick. The navigation bar was dragged to the view in storyboard (not created programmatically) and it shows up just fine.
I looked at the following similarly asked questions:
-> How do i add a 'back' button to a UINavigationBar manually?
-> How to add a button to UINavigationBar?
-> How to programmatically add a UINavigationBar and a back button on it
but they all point to just embedding the view in a navigation controller, which again, is not what I am trying to do.
If someone can please help me out, provide some sample code I would greatly appreciate it.
Try drag-drop a UIButton object. I have always added manual back button (hardly took the in-built one)

ios storyboard tabbar > ViewController > TableView

I would like to create the following navigation
I have a tab bar program build with storyboard
and I have a View controller with buttons
when I click a button A navigation controller is called
Right now I have made all the connections and everything works fine but..
in order to create the change from the button to the table view I am using modal segue and that removes my tab bar.
I know that push will not work cause its not a navigation but how can I work this out?
I had the same problem but I realized that the best option is do it using a push segue. It's the best option because when you have a table view into a tab bar item it's more usability, it's what customer want. I'm sorry for not solution your problem but I strongly recomend you to use push.

Resources