How to make a nav bar that can move to another views - swift

Here is a photo, I need to make this when you click on the right button it is moving you forward and backward for the left one.
Here is the result I want:
The buttons moves you to a different views

I think you can create a view and add label for title also page controller too after that add collection view under view and enable pagination. Use custom nib file for views (screens).

Related

Scrollable tab bar in swift

I'm using a tab bar view controller with more than 5 items and it's showing as the fifth item an item named "More". I want to avoid that item and make the scrollable tab bar.
ThanksImage
I don't think you can subclass UITabBar and get what you want.
You probably need to create this as a custom UI object. You could create it using a UIScrollview.
If you are a beginner then this is likely over your head.
I know this is old but maybe you could add a UIView to a Tab Bar Controllers scene (not the actual controller) and then add a UICollectionView on top of that same UIView of yours to create a custom Tab Bar. You would have to change the size and flow layout for the collection view but other than that if you are familiar with switch statements and delegates I don't see why it couldn't work!

Tab bar at top and bottom

I would like to develop a ipad apps which has a menu at the top of the screen as well as at the bottom.
There are four buttons on the top of the screen, and there are 10+ buttons at the bottom tab bar, which can be scrolled horizontally.
How can I write the root view controller as a framework for this operation?
Should I customize the UIViewController class or UITabBarViewController?
Thanks
EDIT:
Sorry for being unclear. Let me restate my question.
Actually my app will have the following hierarchy.
'Front Page' is simply a page (view controller) for user to choose language. After choosing the language, 'Menu Page' view controller is displayed.
Starting from Menu page and ALL view controllers (VC) in below, the page layout is something like this.
As you can see, there are top menu and bottom menu. Clicking on the buttons the app will quickly jump to the corresponding view controller (3rd level in the tree, VC1,VC2,VC3 etc) . And for every view, there is a BACK button on every page, clicking which will back to the parent view controller.
I was thinking to implement this by using a tab bar view controller and a navigation view controller but I still do not have a clear idea how to implement this.
Or maybe should I just use the navigation view controller and hide the top tool bar except the back button, and display an overlay UIView as menu which is on top of all other UIViews.
Can somebody help me? Thanks.
Since this is the outermost container for my app I hope to do it properly at start..
Sorry for my long question.
If you really want to develop a framework for this logic .You need to create Manager, ViewController, View, DAO ,Model and other classes according to your needs.
I assume you want to add the buttons dynamically to the tabbar (and if it scrollable , it must be a scrollview).You can use Toolbar for upper view but then it won't be in sync with the bottom-view(visually).In that case you will have to create your own customized views to look like a tabbar.
The manager will basically keep a track of all the buttons and different states of events and action on the views and the same information can be accessed via a static method form the viewcontroller.
Well you have not detailed on your needs , so it's difficult to predict the entire architecture.
You need a container view controller to manage selection of VC's 1-4.
clicking which will back to the parent view controller
Parent view controller is used to mean the container vc in a container view controller scheme - I'm not sure that's what you mean in this comment. Where exactly does the back button go?
See this link for more info about container VC's.
https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html
You should be able to embed a tab bar controller in the content view of the container VC. Should be able to but it might be really buggy if there is a lot of communication between the child vc's.
The hard part is the back button. Basically it must be a button that goes back to VC 1-4 depending on which section you are in. The easiest way to do it is to make sure that when you cycle view controllers, pass the back button information as to which VC is the current child so it knows which VC to navigate to when you press it.

How to access additional UI element in Interface Builder (Storyboard)?

I can drag & drop a ui element from the "objects-selection" and add it to my current scene (marked red in the picture) but how can I edit it? Xcode doesn't show it in the editor, nor does double clicking the element make it visible.
Depending on what you want to do with it.... Perhaps you could make it a subview of the current view in order to configure it and then remove it from its superview in code if you don't want it to appear.
Based on the hierarchy picture you provided, you are aware that the view you added is not part of the view controller's view hierarchy, correct? You would need to set the view controller's view property to this view in order to see it. If your intention was to add this as a subview of the current view, you should drag the view from the object repository directly onto the view. Alternatively, you can drag it from the View Controller Scene on the left and associate it as a sub view that way.
Also, note that when you pull the view onto the canvas, it's white. It may have been there and you just didn't see it if you had originally made it a subview of the current view.
I suppose the right way would be to add the extra view to the view controller's view, and have it hidden. Yes, it is going to be a pain to configure views this way. On the other hand this way those views do got the proper memory treatment and can get unloaded under memory pressure.

Switchable subview in window for iphone app

I've been looking everywhere but can't seem to find any examples/tutorials for my situation (not sure how to google it..)
So i have a window where a portion of it should be static (buttons and such) and there is a dynamic part (bottom leftish) that should change subviews.
So what i'm looking for is a way so that clicking the buttons in the static area will change the dynamic area to a view of my choice. I have no idea how to do this using the IB, but doing it programatically seems the only way. Any suggestions(I do not want to use a tab bar controller)?
Oh, and is there a benefit to making views and such programatically vs through the IB?
Thanks!
You can also achieve it programatically. Just create another viewcontroller class (as many as u want). In the loadView method of it create a UIView in the coordinates where u want to add the subview in the current view. Now create an instance of this viewcontroller class in the currentview controller and add it as a subview. You will get the subview at the desired location.If u want to change it dynamically create as many views and then add them to the array and change them whenever the button is clicked.
Hope this helps.
You should perform the switch in your view controller. The static buttons can have their actions hooked up to that controller (in IB), which can have an outlet (in IB) to the subviews and perform the swap.
As for when you should use IB, see this question.
You can do it from interface builder as well. You just need to take viewController from interface builder drag-n-drop to main window. assign IBAction to all buttons to add different viewController's view to main window just make their frame some smaller.
if u want to change or views by click on button then u chose segmentcontrol switch. and cod for each segment like as when click on segment 0 then open first sub view and when click on segment1 then open second sub view. And make by default unselected so that ur static view will appear initially lunching of view.

iphone: Button/Image on top of TabBarController?

When in the Camera Roll section of the Photos app, you can click the top right button to edit the photos. This replaces the bottom tab bar with three new buttons.
I would like to do something similar, but I cannot get my buttons to be on TOP of the tab bar. Is there a way to specify the layer order? Or do I need to do something different?
I would add a new UIView. I would add it to the view your tab bar is in (like, let's say UIWindow). From there you can use -bringViewToFront (or something similar). That way you will have control over what is in front of the UITabBarController's view.