How to make a tabbar such that the first tab of the tabbar should not remain selected - iphone

I have created a Windows application.in my appdelegate I have called a controller class named analogcontroller and added this class to my window so that when I run my application the page that should come first is this page that contains an analog clock with five tabbaritems in it each calling different class.
So in the analog controller class xib I have added a tabbar with 5 tabbaritems in it. But when I run my application the page that gets opened is the page of the firsttabbaritem instead of analogcontroller. I want that when I run my application my xib of analog controller should be called with 5 tabbar items below it and when I click on particular tabbaritem then only its corresponding page should be opened, otherwise not. How is this possible?

you can set tabbar selected index to your desired tab index it starts from 0
you can write something like tabbarcontroller.tabbar.selectedindex =1;
Forgive syntax errors... you should try this. xCode is rich editor.

If you have a visible tabBarController, then something will necessarily be selected. No way around this.
However, if you would like to hide the tabBar, then you can certainly do that, either by setting its hidden property to YES or by presenting a modal view on top of the selected tab (e.g. the first viewController).
similar question here

Related

How i implemented an Tab into UITabBar without seeing this tab as item?

I have an UITabBarController which has 5 Tabs. So, my problem is, i want to make an welcome screen into the UITabBarController, but this screen should be just only one time visible, when the app started. After the screen appears and the user switch the Tabs, he can't go back to the welcome screen, otherwise he must quit the app and open it again.
I tried to make an UIViewController as an RootViewController, but he dont show me the UITabBarController instead.
Is there any way that i can solve this problem over the storyboard? Also with code it will be also okay.
If I did not misunderstand your question these ideas will help you;
Add an extra tab to your tabBarViewController , make it welcome view and make this view controller initial VC so user when landing to tabBarViewController this view will appear after few seconds change tab index selectedIndex as you desire from UITabBarViewController then hide welcome view button from tabBar.
Seond way : Inside UItabbarViewController create custom tabbarView (scrollable) you can use collectionView it's easy to implement and it cells selectable like buttons. Hide original tabbar make welcome view appears first, make its index sixth then change selectedIndex programmatically when you need and disable scrolling from collectionView with this way only your five buttons appears on screen and welcome view button automatically remain out of screen.
You can find example code in my Github repo UICWaveTabBar, UICSlideTabBar , UICExapandableTabBar
Fist link including .xib file, you can edit it from storyboard, second and third only code

iPhone app: navigate to tab bar scenario

I have an application with a maybe-strange navigation scenario. I'll try to explain:
1) first scene: select an available item from a list
1.1) once selected, you navigate to a tab view allowing you to view/edit the various attributes
2) if the desired item isn't available, you may create a new one (by selecting a "+" bar button) which navigates to an alternate scene
2.1) there may be multiple scenes required to create the item, all scenes are simply pushed on the stack to allow the user to go back, select different options, etc.
2.2) once all scenes have been displayed and all attributes have been collected, the new "item" will be created and saved.
2.3) now, I want to automatically act as though the user selected this item from the beginning, that is, I want to pop all previous views off the stack and navigate directly into the tabs (step 1.1).
Does this make sense? Easy to do? Is there a better way to go about this? I'm using xCode 4.2 with storyboards.
Any guidance would be appreciated.
If you want (+) button on TabBar you should subclass UITabBar: Fo ex. TabBarPlus and set this class in storyboard.
But easier place (+) button on navigation bar.
The max number of displaying tabsart is 5 for iphone and 8 for ipad. If the there > number of tabs the last is "More" tab thet displaing list of other tubs in tableview. I you want displaying more tabs on tabbar then you should subclass UITabBar :)
If you want by back button on naigation bar switching beetwing Views that references with TabBar buttons you must create stack in code and hide backbutton of navigationbar and use castom left button of navigationbar.
The other navigation can be easy done in storyboard

View-Based Application? - Please explain

XCode: "This template provides a starting point for an application that uses a single view. It provides a view controller to manage the view, and a nib file that contains the view."
What does that even mean? (ie what does Single view actually mean)
1) This means that your application will only have a single view screen that is active
2) This means that your application will be able to have as many screens as you like using a single view controller.
Ok now what if your application has multiple screens? not a single view screen, is still suitable under a view based application template?
Example
Screen1(main): on this screen you have 3 buttons, "Open Form1", "Open Form2", "Open Form3"
When the button is clicked it opens up the associated screen,
Press the "Open Form1" button opens up "Form1" screen2
Press the "Open Form2" button opens up "Form2" screen3
Press the "Open Form3" button opens up "Form3" screen4
When the user completes the form and submits it, a thank you screen is displayed
therefore in this example there would be a total of 5 screens.
Each form screen contains is different, textfield inputs, and information, is this considered as a view based application?
View-based app is just a template to say that your app will be view-based. That means that you can have any number of views you want, as this template comes with a view controller (that, as the name says, can be used to control the views... show/hide them with animation, for example).
The template starts with ONE VIEW that is added to the app view controller. You can add any number of views to that controller.
So, yes to your questions. You can use this to create the app you mention, where any of the "screens" you mention would be a view, for example and you can show each one using, for instance, the app view controller to animate each view showing or hiding.
That means the template will create one view and corresponding view controller along with app delegate, main window. That will also do the necessary things to add this view to main windows, and load when app runs. This is just a template. Then you can crate any number of views and view controllers as you want.
This means that the template you are starting the project with provides a single ViewController, and associated XIB for the View. As the first answer says you could use this template to build the application mentioned.
HOWEVER you may wish to think about how the user is going to interact with your app. Will you allow stepping back and forwards through the screens, in which case you may want to consider the Navigation Based app where you push/pop screens onto a stack to allow easy movement between then.
You might also have a concept of allowing the user to jump at will between each of the screen pages in which case you might want to implement a TabBar application.
Or you could just implement it all yourself. At the end of the day it will be your application design, and the template is only a starting point to get you going. I would suggest that if you are starting out with iOS development however to go with 1 ViewController matched a XIB for each screen you wish to implement to keep things simple.

UITabBarController Initial View?

I'm wondering if it is possible to start my app with all my tabs in the "up" state and show a "landing" view to the user. Kind of like a welcome/quick start. When they select one of the tabs, it switches views as normal.
Will you point me in the right direction?
Kind of like this:
If you're using a UITabBar/UITabBarController, I think you must have the selectedIndex set to some legal value. I don't think this is possible, nor can I find an app on my iPhone or iPod that mimics the behaviour you're looking for.
(The App Store app is as close as it gets, where it looks like it has an empty tab bar before it loads data from the Internet, but it could very well be that they are just re-using the Default.png and superimposing an activity indicator during loading.)
Note that if you tried to submit your app to Apple, they could easily reject it for using non-standard UI.
The way I would probably do this is to create a new ViewController that's just for this screen, but make sure it's last in the viewControllers array managed by the UITabBarController. That way, when you show the tab bar on the screen, you get the 4 tabs and the more button, but the currently selected view controller is not in the bar, meaning that all of the other tabs are unselected.
Once the user has satisfied the condition for showing the screen, you can discretely remove the view controller from the tab bar, and the user will never be the wiser.

didSelectViewController not being called when switching tabs manually

I have a tab bar interface with three tabs. I would like them to animate when I switch between them. I implemented didSelectViewController (and all the associated delegate stuff) which is called when I press the tabs but not when I switch tabs programmatically. The docs say as much,
"In iOS v3.0 and later, the tab bar controller calls this method regardless of whether the selected view controller changed. In addition, it is called only in response to user taps in the tab bar and is not called when your code changes the tab bar contents programmatically."
Anyone know any workarounds?
Thanks! - Jon
Well, if you are switching them programmatically why can't you create proper animation yourself? I mean you do know which tab gets selected, right?
you can call the method when you switch them programmatically yourself. or write another method to do your animation and call IT whenever you switch tabs programatically