How to swap position of tab bar item when refactored storyboard - ios

When i refactored storyboard same photo in this
link.
I can't find where i can swap position of tab bar item.
example i want to change main menu to index 0.
this is my storyboard.

You can just re-arrange the order by dragging and dropping the icons in the tab bar controller
If you are using custom tabs, you can still drag and drop to reorder even though the Tab Bar Controller scene shows a grey bar, the bar item is still there. This is especially inconspicuous when all your bar item are custom items.

Remove all relation and start making from MainMenu to what you want at the end.

Related

Remove default slide right animation on UITabBarController from "More" Menu

I have a situation where I have enough tabs on a tab bar controller where the default system functionality has introduced the famous "..." more icon.
This is totally fine and I'm happy with the menu that is popped up when you tap it.
What I've noticed however is that a default transition occurs when selecting a item from the "more" menu (basically a slide right) to load the VC from the menu. Unfortunately this also introduces a lag on the accompanying slide "left" to get back to the menu.
My question is if this is default behaviour I have to live with or if this is something I can remove completely (ideally no transitions would be my preference).
Thanks,
Andrew
May this help you:
The More Navigation Controller
The tab bar has limited space for displaying your custom items. If you add six or more custom view controllers to a tab bar controller, the tab bar controller displays only the first four items plus the standard More item on the tab bar. Tapping the More item brings up a standard interface for selecting the remaining items.
Solution to your query:
Add only Five view controllers in your tabbar controller.
For last Fifth view controller, add more tabbar button icon (or any other image icon) manually and set a similar looking tableview (menu list).
Handle further navigation for remaining (Sixth onwards) view controllers, manually from tableview (row selection)
Storyboard Layout:
If you are looking for an alternate of more navigation, then you must customize tabbar controller and this may help you:
ZRScrollableTabBar: Scrollable tabbar items
IDScrollableTabBar: changing tabs with left and right swipe gestures on the tab bar.
JFATabBarController: Swipe tabs left and right
Ask me, if you want more clarification here.

Can't select tab bar items, greyed out tab bar

My nav bar is completely greyed out. I've seen some solutions like this saying that you should simply add an image to the tab bar item. I can't even select a tab bar item...see screen below.
Any ideas? I'm running Xcode 7.2, using Swift with a BaaS (Parse). I've searched for hours/days and can't figure this one out...May sound like a dumb question, but every other example I search essentially shows a tab bar with items that you can select/edit within the interface builder. As I can't figure out how to select a tab bar item within the interface builder, I've essentially been stuck. Do I need to do this all programmatically (I know some people have preference here), or can it be done in interface builder?
I add them as has been mentioned (using a view controller relationship segue, images below), but after I add it, everything is still greyed out and I don't have any tab bar items. Any ideas?
control-click action, using relationship segue under view controller
everything is greyed out, no tab bar items available to edit or add images to
Ok, here we go. You have a Tab Bar created.
Drag a View Controller to your storyboard. Place it next to your Tab Bar.
Ctrl-click on the Tab Bar and drag it to the View Controller.
Select the option like the image below.
About this this you must see the item on your tab bar. Click on it and you'll be able to edit (choose an image, change the label...).
Hope that helps.

Dragging Bar Button Item to Navigation Controller fails

I am following a tutorial on Udemy about Navigation Controllers.
The instructions are to drag a Navigation Controller onto the storyboard, and then drag and drop a Bar Button Item on the right of its navigation bar to segue to another view controller.
However, when I drag the Bar Button Item to its would-be position on the navigation bar, no drop-zone gets highlighted, and the button gets added to a random tab at the bottom of the screen.
I have tried finding references to this problem but all solutions are programmatic and given the wysiwyg nature of iOS development I would like to solve it through XCode UI.
Is there some setup I must change or is this an XCode 7 discrepancy?
Try to add a ViewController and then in Editor -> Embed in -> NavigationController. Then it should work.
I have solved my problem by dragging the Bar Button Item into the Document Outline, below Root View Controller.
This automatically creates Left Bar Button Items and Right Bar Button Items, which gives you an opportunity to drag the Item in the section of the controller you like.

How to Add a Bar Button Item on a Disappeared Navigation Bar using Storyboard?

I want to add a bar button item on the navigation bar. (Say View 1 here.) The view that will segue to View 1 is embedded in a navigation controller.
However, the navigation bar is not showing in this view.
If I use attribute inspector to add a opaque/ translucent navigation bar, there will be a navigation bar in View 1. But if I drag in a bar button item, it cannot be shown in the storyboard. Though the bar button is in the document outline, it cannot be shown on the storyboard. Also, if I run the application, it is not on the screen.
When running the application in the simulator, View 1 will have a navigation bar on the top of it, since I use "Show" rather than "Show Details" to show View 1. I tried to embed View 1 in a navigation controller again, but it won't help much.
Can anyone tell me how to add a bar button in this situation using storyboard? And why the navigation bar is missing from the storyboard?
Thanks in advance.
I figure it out by myself.
Drag a Navigation Item from the object list, and then add bar button item to it.
Thanks to rdelmar for his idea, though drag out a navigation bar won't work in the way I thought it should work.
In my situation, View 1 is a table view. Drag a navigation bar to the view will cause it to be the header view for the table, rather than a navigation bar I had expected. Then there will be two navigation bar in the view when I run the application.
Of course we can drag out a navigation bar and add a button to it, it might work different with your expectation. As I had said, it might leads to a view which contains two navigation bars.
You can fix this by drag out the Navigation Item (contains the bar button you had added) inside the Navigation Bar out. In my situation, I drag it out and put it the same level with the table view inside the document outline. Then it won't become the header view for the table view.
After that, we can just delete the navigation bar from the document outline.
I have no idea why the navigation bar disappears in my storyboard. If anyone has some idea for this, please let me know.
It sounds like you're adding the navigation bar by using the Simulated Metrics. If so, this doesn't add one at run time, it's only for layout purposes in IB. You should drag out a navigation bar from the objects list, and add your button to it.

bar button in Xcode always goes to bottom Xcode 6.3 beta

when i drag the bar button item onto the view controller they will not stay at the top of the view they will automatically go to the bottom under the table view. Does anyone know what is wrong?
You can fix this by moving the bar button item under the navigation item, inside document outline windows.
Before
After
That should fix the issue. I verified the issue in Xcode 6.3.2
If you navigated to this view-controller via a push segue, it does not have an instance of the navigation bar in storyboard.
You need to drag in a "Navigation Item" object, and then you can add your Bar Button Item on to this.
indy and timbrah's fixes didn't work for me... but the below did.
To fix this, select Navigation Item in the Object Library and drag it onto the Root View. Note, it replaces the current one. Then you can drag a Bar Button Item onto as you like. Hope this helps.
Actually, it seems as if the top bar isn't clearly designated as a navigation bar anymore. I had to select Root View Controller (first icon at the very top left of the screen) then chose the Show Attributes Inspector and at the Top Bar line item under Simulated Metrics chose Translucent Navigation Bar. That enabled it as a navigation bar and I was abled to drag a bar button item there. Weird!
I had same issue today with XCode 7. I have next stack: NC-(root)->VC1-(Show (e.g. Push))->VC2. After I've created VC2 there was no Navigation Item at all. To make it appear I changed segue type from Show (e.g. Push) to Deprecated Push and brought it back to Show (e.g. Push) and now I can use it correctly
You have to drag the Bar Button Item to one of the sides of the navigation controller's navigation bar. So, in your screenshot it would be all the way to the right or left of that bar that has "Root View Controller" in it.
From what I can tell this bug is still around in the 6.3 release. The only way I've been able to add items when this happens is to drag them under the navigation item in the left hand sidebar.
In my situation needed to select ViewControllerScene inside the document outline then forward attributes inspector then change Top Bar to Translucent Navigation Bar

Resources