iPad show a view not inside Tabbar - ipad

I am developing an iPad application.
My application is a UITabBar based application with 5 tabs.
Now my requirement is to show a view controller outside these 5 tabs.
Explanation:
For example I have 5 tabs, A, B, C, D, E.
A is selected by default.
Now I have to show a new view controller say, F. But when I show that view none of the tabbar item should be selected.
What I have tried:
I created a UINavigationController as 6th tab. Now its not visible at the bottom and it nearly produces the effect I needed but have following two problems.
Tab bar items are not center aligned (Due to one hidden tab at right)
User can tab that hidden tab
Update:
Actually I am following an already developed application and I am sure its possible.
Scenario is I have 5 tabs that user can access without login. On navigation bar I have login button. When user is logged in I have a menu button in my navigation bar. Now tapping menu will show a view that doesn't belongs any of the tabs below. And that's why I need implementation explained above.

Work around I used to achieve above effect.
When I need to push my new UIViewController for which I want to deselect all of the UITabBarItem of my tabBarController, first I do the following things
Set selected index of tabBarController to last tab.
Set deselected image in last UITabBarItem
Get navigation controller of last tab and pop it to RootViewController.
Now push my new controller
Hide back navigation button in my view controller.
Hence I am able to show a Viewcontroller keeping user experience as current view is not in any of the tabs.
Thanx.

Sounds like a job for a modal view controller, i.e. one that's displayed in response to some user interaction other than selecting it via the tab bar.

Related

Changing tabs on Tab Based Application Pushes UI Elements Down

I have a tabbed based iOS application. The fourth tab is linked to a UINavigationController. When I navigate to the home tab from the fourth tab, the UI elements of the home tab are pushed down. However, if I rotate the phone to landscape and then back to portrait, everything has moved up and is in the correct place.
In Storyboard, I set the top bar to none. I have the UINavigationBar hidden in the fourth tab/view controller before I navigate to the home tab.
Why would it be that the rotation fixes the constraints? How can I fix the UI elements such that they are not pushed down in the first place?
Here is a screen shot of my storyboard:
Your question doesn't really make sense. A 4th tab would not be embedded in a navigation controller. Instead, the 4th tab would link to a navigation controller. When you first select that tab you'd see the root view controller and it's navigation bar item. If you pushed a new view controller it would get pushed onto the navigation controller in tab 4. If you switch to one of the other tabs then the navigation controller will be swapped away and it's navigation bar will no longer be visible. Swap back to tab 4 you'll see it again, complete with it's navigation bar.
I created a sample app in order to confirm what I'm describing, as I haven't used tab bar controllers a lot, and not in quite a while I can upload the project if you really need to see it. It only contains a couple of lines of code (to implement the button on the navigation controller's view controller that creates and pushes a new view controller.)

Custom/common toolbar in Swift

I'm quite new to Swift and am working on an app where I'm not sure how to setup the navigation. It works with a tab bar, except that I want the bar to display nomatter what view is being displayed. There are 4 "main" views that the user should always be able to get to. The problem comes when I get into subviews of one of those main views.
I have the tab bar with the 4 icons for the primary views. It's currently displaying the "activity list". When the user clicks on an activity, it will display a list at the next level of detail. However, that view is not one of the primary ones that is represented in the tab bar, so it has no tab bar and no way to transition directly to one of the primary views. You have to back your way out to the Activity list before you can select a different tab.
Say that the main views (represented in the tab bar) are A, B, C, and D. I want to be able to display the same toolbar on all sub-views (e.g. C-1, C-2, etc.) and allow direct transition to any of the other main views, without the user having to manually back out of each sub-view.
What is the "best" way to accomplish this?
1) Should I be creating a custom toolbar object that gets implemented on every view controller?
2) Should it be a combination of tab bar and tool bars?
3) If I have drilled into a stack of views, do I need to pop all of those views individually before I can switch to a different tab?
4) What do I use as my "root" view?
Thanks for any suggestions. I have hunted, but haven't found an example of a scenario quite like this.
I think I figured it out. I needed to embed each "tab" view in a navigation controller.
So...
Tab Bar Controller --> Navigation Controller --> View Controller --> "view stack"
The tab bar now remains at the bottom for every view, and if I touch the tab icon a second time, it goes back to the original tab view controller.

How to create a UIView with NavigationBar and TabBar

I would like to introduce in my app a View that will contains both navigation bar and a tab bar at the bottom. View contains a Table View with multiple entries and once user tap on a cell a push segue takes him to another view with details regarding the cell he has previously tapped. If he decides, user can go back to parent view by tapping on 'Back' button of the navigation bar on top. In addition to this, I would like my view to have a tab bar at the bottom with extra tools for the user. So, if he decides to check the 'Creator' of the app, he can by simply tap on 'Creator' TabBarItem at the bottom.
I would like to ask you what is the best way to achieve the above. I have already tried to use UITabBarController combined with UINavigationController. Didn't achieve what I was looking for because I would like the view with the table on it to be independent from the TabBarController and NOT a part of it (by part I mean by accessible through tabs).
Do you believe a UINavigationController view with UITabBarView would be a better choice?
UPDATE
What I mean by, "independent from the TabBarController and NOT a part of it":
Once the app loaded, I would like to see my main view (with table) contains Navigation Bar on top and Tab Bar at the bottom. However, I don't want to see the first tab of the Tab Bar selected because my main view will not be accessible through tabs of the Tab Bar but through Navigation Bar. If, for example, I am in Main view and tap on 1st tap, I would like to move to another view that will contains some other info.
Option 1:-
Create a tab bar Controller and on that TabbarController assign your navigation Views.
say nav1 with tab1 , nav2 with tab2...
Option 2:-
Create a Navigation View Controller and than add the tabbarcontroller on that navigationView Controller by using addSubView.
So when the user clicks on a row in a table u will go to a different View which doesn't have the TabbarController and when the user comes back he will again see the TabbarController.
This is what I will do:
First I will subclass UITabbarController and create for example ParentTabBarController. This controller will contain all the tabs necessary and what they will do if they are clicked so on.
Next for each viewcontroller I create, I will subclass from this ParentTabBarController so that the tabs are already in. You can add additional functionality or override it depending on your situation.
In your appdelegate pass in a navigation controller and every time push and dismiss the viewcontrollers you created in second step.
Hope this helps..

Xcode - How to attach a tab bar to a view without adding a tab for the new view

I have an application which has 5 tabs. I also have another view which you can access from tab3 via a selection of buttons. I will call it view 3b. View 3b populates with information based on which button the user selected in view 3. After the user puts in all the information required the app automatically takes them back to view 3. I want to add the tab bar to this view(3b) but I do not want it to have its own tab. I just want to use it so the user can navigate out of this view back to the rest of the app if they want to exit the screen early. Does anyone know how I can attach the tab bar to this screen without having a tab added for this screen. I am using Xcode 4.6.2 and am using storyboards to set up my app.
Any help would be appreciated. I've done a bit of searching but everything I find just explains how to use tabs.
Any help would be appreciated. Thanks.
It sounds like you need to use a UINavigationController.
When you set up your UITabBarController, instead of linking the third tab directly to your 3rd view controller, connect it to a UINavigationController, and then set the root view of that UINavigationController as the UIViewController you want as your third tab.
From there, you can set up your buttons to perform a push segue to your second view controller (view 3b from your question). If you do this, not only will you keep the tab bar on view 3b, but a back button will automatically be placed in the top left of the page so the user can simply go back to view 3. If you don't want the navigation bar that appears to be there, you can instead uncheck the "shows navigation bar" checkbox in the UINavigationController's attributes inspector.
I hope this helps!

STACKING OF TABS similar to iPad Chrome app

I need to develop tab bar similar to Chrome's tab bar functionality on iPad. If the user opens more then 5 tabs it displays the extra tabs as a stack:
stacked tabs http://uploads.hipchat.com/26718/169836/yfzwdgq80m4rzbw/Screen%20Shot%202013-04-10%20at%202.36.56%20PM.png
How can I achieve this?
There's nothing like that built into iOS, so you're going to have to implement it yourself. I'd suggest implementing the tab bar portion of the window as a separate view that knows how to draw the individual tabs, including the currently selected tab, and which sends an appropriate message to it's target or delegate object when one of the tabs is tapped.
You can build a UINavigationController like Controller, with its own stack. If you are targeting iOS 5.0 and above you can use childViewController. The controller will have a tab bar, and container view. You will add view controllers to the stack of the Controller. From the stack you can form the tab bar item View, using titles of respective vc and views can overlap.
When they are selected bring the tab bar item view to the front and add the respective viewController as childViewController to the CustomTabBarController.

Resources