Two storyboards, both contain TabBarControllers. How to segue between them? - ios

I have two storyboards, and both contain a TabBarController. Let's call the first storyboard/TabBarController Groups and the second Users
When I segue from Groups to Users, the Users UI appears, but the Groups tab bar remains.
How can I segue from Groups to Users such that the UI and tabbar changes.
EDIT:
My goal

What you're asking to do is perfectly legal and easy. Simple do a present / modal segue from one UITabBarController to the other. This will completely replace the interface (the first tab bar controller and its tab bar) with a new interface (the second tab bar controller and its tab bar).

Don't use segue for this. It is impossible to let UIKit know what you are really want to do is switching the tab, it just think you want to create a viewController instantiate from storyboard and push it into nav stack.
Try this:
self.tabBarController?.selectedIndex = // the index of your dest tab, start from 0

What you're asking is against Apple's guideline regarding Tab Bar. That said, I'm sure you can do it if you really wanted to, but I'd suggest you rethink your design because:
Design perspective: Apple's HIG is pretty sensibly laid out for a smart phone environment, so following it is more helpful than outright ignoring it.
Practical perspective: Your app's chance of getting rejected at App Store will be higher.
From Apple's iOS Human Interface Guideline:
Use a tab bar to give users access to different perspectives on the
same set of data or different subtasks related to the overall function
of your app.
In general, use a tab bar to organize information at the app level. A
tab bar is well suited for use in the main app view because it’s a
good way to flatten your information hierarchy and provide access to
several peer information categories or modes at one time.
Don’t use a tab bar to give users controls that act on elements in the
current screen or app mode. If you need to provide controls, including
a control that displays a modal view, use a toolbar instead (for usage
guidelines, see Toolbar).
Link

Related

How to present navigation controller from a seperate viewcontroller

I am building an Onboarding/Welcome screen for my app, but the problem is that my app has a tab bar, so my Onboarding somehow interferes with that and doesn't look like a seamless interface. My solution is to put the Onboarding thing on a separate view controller and once a user is done with that screen, it presents the navigation controller and all of ITS views. I have done some research on this, but I'm still lost. If you have any other ideas, or have solutions, please let me know, thanks.
Here is what I want to achieve:
In order to do this in a way that looks nice and works well you should not be pushing or presenting the tab bar but updating the root view controller of the whole window.
I can’t provide a code example right now but there will be several online sources for this.
You should be changing the view controller so it essentially toggles the app between “logged in” and “logged out”.
That way you don’t have to worry about how to get from one to the other. They act separately just dealing with their own stuff.

Combined tab view and split view

I’m working on an app which combines a tab bar controller with a number of split views, so that each tab item shows a different master-detail view. I want the tab to be visible at all times so the user can switch directly between master-detail views.
I can achieve this by having a separate split view for each tab, but I'm not sure whether this is approved by Apple. The view controller catalogue for iOS says "A split view controller must always be the root of any interface you create." However the UISplitViewController API reference says "Although it is possible to install a split view controller as a child in some other container view controllers, doing is not recommended in most cases."
As an alternative approach, I can have a split view as the root, with a tab controller on the primary. This means though that the tab is hidden on compact width devices when the detail view is shown. The user has to navigate back to the master view to switch tabs. This is not the behaviour I want and is not what happens with the Apple Music app for example.
So, a couple of questions:
Would Apple reject the app if it has a tab as the root and multiple split views?
Is there another way of achieving what I want?
Many thanks.
Your quote says "not recommended", not "your app will be rejected".
The only wishes you have expressed are "I want the tab to be visible at all times so the user can switch directly between master-detail views". That doesn't really leave room for alternatives. Also, you haven't described your app. It might be that your design choice is not suitable for its use cases.
It sounds like you want us — a third party — to speculate about whether Apple would reject your app. This is not the right forum to ask for that, but I say try, and you'll get a definite answer.

using UITabBarController not in top level view

i'm building app for cars ...
app first view is cars listed in table "UITableViewController", when user select a car "cell" the app navigates to "UITabBarController", because for each car there are a lot of infos and specification that need to be displayed in separate view, so i use here "UITabBarController"
so the tab bar controller is not in the top view level....
Question 1: is this correct usage of the UITabBarController? i'm afraid of getting rejected from apple app review ,i read in apple docs
"In general, use a tab bar to organize information at the app level. A
tab bar is well-suited for use in the main app view because it’s a
good way to flatten your information hierarchy and provide access to
several peer information categories or modes at one time."
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW41
Question 2: are there any apps in the market that don't put the tab bar controller in the top view level! plz give me links to them......
The key words here are "peer information categories". That means information which is related by a common theme, in this case a specific model of cars.
So a structure that had a tab for engine data, a tab for interior spec, a tab for fuel performance and so on would be perfectly fine. All the tabs display data that relates to the same car. What would make less sense is if you mixed things up by including a tab that wasn't related to the selected car.
Ideally you'd want to embed the UITabBarController in a UINavigationController so that the navigation bar would display the context (say the car name or something similar) and a back navigation button to provide access back to the table view.
Yes, it's, your app will not get rejected.
There are should be app using the tabbarcontroller like you are going to use, but I don't know them.

Best way to combine UI Navigation Controller with UITabBar Controller?

I'm at a point in the development of the app I'm working on where in order to complete the assignments given to me, it seems like the best way to accomplish what I need is to combine a UINavigationController with a UITabBarController.
Structurally, the app has a home page, and the rest of the app is navigated through the UITabBarController. This is a sound design for the original, but when I took over the development process of this, I had to make a lot of additions to the app, and there's technically supposed to be a "second" section which adds extra "features" if you will that aren't necessarily related to the main functionality of the app itself.
Basically, since everything begins at the Overview, the user is supposed to have a choice between just diving into the app itself, or using some of these extra features. I'm thinking the Navigation Controller would be fitting for the extra features, but I'm not sure how I can add to it.
What I need to know is - is this solution to the problem sound? If so, what's a good way to accomplish this? Is it ok to have a separate UIWindow class to link the Navigation Controller up with the TabBar Controller?
Granted, this app has used a lot of nib files, and every time I've tried to do something programmatically, it just hasn't worked. Thus, if someone could point out a NIB method of achieving this, I'd appreciate it.
According to Apple recommendation, UITabBarController should always be the root view controller of your app. So basically your main view is just one tab of your tab view controller, and so you just need to embed your main view controller in a navigation controller. This way you can navigate to whatever page you wish within that tab using the navigation controller, or you can go to other tabs using the tabbar controller.

Loading UISplitViewController on UIButton click

The Flow of my application is
Application Starts -> TopMenuViewController ( Which Contains Several Buttons & navigation controller ) -> When particular button is clicked -> Load Split View Controller.
The user can go back to TopViewController. In short I want to load UISplitViewController on button click. How to do this? Thanx in advance.
In my experience, there's no good way to load a UISplitViewController on demand like that. It has to be the root of your entire user interface, or you will pull your hair out trying to make things work.
I've reworked several app designs to fit into this requirement, and it's generally not been difficult at all to come up with something functional and attractive which fits into the split-view-at-all-times paradigm. You can freely swap the views loaded into each side of the split with login panels, empty placeholders, etc. to make your flow work with the splitview.
There are third-party split view controllers that mimic Apple's and allow later loading (as well as master pane visibility in portrait, and other features). One is Matt Gemmell's MGSplitViewController. You could also come up with a different presentation altogether for your master-detail hierarchy.

Resources