Swift 3 Navigation Bar Item Scrolling - scroll

Is it possible to have the items in a navigation bar be scrollable? In order words, if I have 5+ items in the navigation bar, I want to be able to scroll through them horizontally. I have seen it with custom buttons and custom navigation bars, but I want to know if it can be done with View Controller with an embedded Navigation Controller.

Related

Why is the bar button item only visible when selected and very dull?

I have added a bar button item in my app and it is only visible on the storyboard when it is selected , it is not visible at all when I run it on the simulator or real device, any ideas of how I could solve this? thanks !
The problem is that you are already in a UINavigationController interface. Thus, adding your own navigation bar to this view controller won't work; it is hidden behind the navigation controller's navigation bar. What you want to do is modify the navigation controller's navigation bar. You do that by adding a navigation item to this view controller, not a navigation bar.

Top offset of TableView embeded in Navigation Controller in storyboard

I have custom TableViewController with plain style Table View and it is embeded in Navigation Controller. I use Refresh Control on the table view and Black Translucent style of the navigation bar and all is setup in storyboard.
The first row of the table view starts right under the navigation bar item, which is ok, and the rows can scroll under the navigation bar which is semi transparent. When user starts to pull the table down to activate Refresh Control, the animation of the refresh object obviously starts at the edge of the screen under the Navigation Bar, and so the refresh object is always partially covered by the navigation bar which can confuse inexperienced users.
Is there a way to tell the TableView to avoid scrolling under the navigation bar and start the refresh control object animation right under the navigation bar? I tried to play with Scroller Insets on table view without any effect.
Thank you.
If you go into the properties for the tableview controller in your storyboard, you can change the size and positioning of the tableview to start after the navigation bar. The problem isn't an offset, but the size and position of the tableview itself. Just move the y position down to accommodate the nav bar.

Incorporating navigation bar in UIViewController in Interface Builder

I'm using Xcode 4, but not Storyboards
We have a navigation controller instantiated in the app delegate.
When we create view controllers with Xibs the xibs are views that are the height of the iphone (without the navigation bar). Putting content in this area is deceptive as there is actually 44pt's less space (the height of the nav bar) which gets put there by the navigation controller.
Therefore how do we remove the room where the nav bar should be in interface builder?
I can click the view and then change the "top bar" to "navigation bar" which will work, but I cannot add bar button items to this navigation bar, which makes me think that this is not the correct way to do it.
Can anyone let me know what the best way to do this is?
Many thanks
When you push your controller or use it to init the navigation controller, the navigation controller should take care of resizing at run time. The area in IB where you set the top bar is under the heading "Simulated Metrics" and is meant to give you a preview of what your selected interface elements will do to your available display area. The "Simulated" part is why you can't put items into that bar.
The real navigation bar should be configured wherever the navigation controller is defined, whether in code or a xib.

How to set the navigation bar to the top in Table View?

How can i set the navigation bar to the top in a Table View within storyboard interface builder? Is it possible?
If i add a navigation bar to my Table View i get it under my records only!
I'm using Xcode 4.3.2
You should not add the navigation bar yourself. Interface builder will do that automatically when a scene is embedded into a navigation controller or part of the navigation stack. So if your tableview is the root controller choose your scene and then go to:
Editor > Embed in > Navigation Controller
Otherwise the navigation bar will be added automatically when you connect a segue from another controller (that is part of the stack) to your tableview controller.

Buttons and input field into "top" bar

Safari on iPad has this bar at the top (it isn't called "toolbar" on iOS, right?), with some icons and input are for searching.
How to put such buttons and input field into Navigation Bar? Is it even a Navigation Bar? From what I read a Navigation Bar has one button on the left, another one on the right and one Label in the middle. But how to create something like that "top" bar from Safari?
If I'm in XCode 4.0 and choose "View-based app", should I then set in the ViewController > Simulated Metrics > Top Bar > Navigation bar? And how to add buttons to it?
Edit
Sorry for the confusion - I don't know if the proper way is to add to a Navigation Bar. I'm just asking for a general overview how such "top "bar" is made. What kind of View do such items belong under?
You probably don't want to use a navigation bar. They are very limited in what controls you can put in them. Try using a UIToolbar instead.
I think you may be looking for the UISearchBar
UISearchBar Sample Code
In the interface builder you should be able to just drag and drop objects onto the navigation bar, as for the little icons, those are just buttons with no border and images. Those images are preloaded in the iOS SDK, so you won't have to make them, but if you want your own then you can make them yourself.

Resources