I have a iPad application where i am using more than one Views. The thing is i want to display the TabbarController page while clicking on Button that is on main page. I am able to call the TabBarController directly from delegate method like adding TabBarController to MainWindow in Inspect window. But the thing is i am asking for users to first login to application and after successful loging, Dashboard appears where i have Buttons. Clicking on button i am displaying Tableview in one Tab bar and in another Tabbar Add to list form.
Thanks in advance,
Sam
What I can get from your post is that you want to have the user log in before the Tab Bar appears with your views.
If that's the case, then you want to set your login view as the main view of the window, and then after they log in set the view to be the view of the Tab Bar.
Related
Attached are two images. The first shows my current main.storyboard, and the second shows my problem when I run the app. I have a tab bar controller that has two tabs. On the first tab there is a button. When pressed, the button goes to another view controller with content. At the top is a Navigation bar with a back button. After viewing content, I press the back button, and am back on the original page with the button, but the tab bar is missing. I have seen a few answered questions, but it appears they made their tab bar in the view controller instead of the storyboard. Another says that I should never return to a previous view unless I use an unwind segue. Is this true? If so, how do I set up an unwind segue. If not, how do I fix this problem otherwise? Thank you.
http://i.stack.imgur.com/IYmX2.png
http://i.stack.imgur.com/7slt5.png
The problem is in the wiring of your ViewControllers. You have probably embedded your UITabBarController inside the UINavigationController and not the other way around.
A correct layout looks like this in Interface Builder :
To reproduce:
In Interface Builder drop a UITabBarController. This will come with 2 UIViewController's already wired in.
Pick one of the UIViewController's (let's call it VController1) and click on Editor / Embed in / Navigation Controller. This wires the VController1 to live inside a UINavigationController that is inside the UITabBarController
Add a 3rd UIViewController next to VController1 Let's call it VController3
Wire in a segue between VController1 and VController3, for example with a button.
I hope that's clear enough
Try Linking the button in your viewcontroller (other than the views of the tabbed bar controller) with the tabbed bar controller. Create a segue that links the button with the controller of the tabbed bar application
I've created a small iphone app that contains a tab bar controller that has been created on the MainWindow.xib. The App Delegate contains the root controller outlet. I'm wondering how I can work in a login screen that will direct the user to my view controller containing the tab bars.
Current Solution:
On didFinishLaunchingWithOptions add subview "RootController" which loads my MainWindow.xib view with tab bars. Then call "presentModalViewController" to present the LoginViewController as a modal. On the login view controller, the login button click calls the AppDelegate to dismiss the modal.
Does anyone know of a better solution? Possibly a solution that doesn't load the page with tabs until after the user has logged into the app.
Thanks!
Make a separate View Controller (lets say A)
in didFinishLaunchingWithOptions check if user is logged in .. if not show A..
implement delegation and pass back login result to the app delegate...and then load the tab bar View
I have created an app and a login and would like to join them together with no luck. The app has a tabbarcontroller with navigationcontrollers via tableviewcells to drill down to other views of the app.
As I am having no luck in joining the two. I have tried to build on from the login that I have done. I can push to a new view but it does not show a tabbarcontroller etc on the next view. I have seen various forums with people having this problem as well.
So, my question: How can I make a new page (login) open to a TabBarController instead of a view (in the middle of my app, not at the launch)?
Does anyone out there know how to solve this issue?
Use navigation controller in tab bar controller. lets say the navigation controller is its first view controller. Now when the root view controller of the navigation is being displayed, you can see the tab bar. Now if you keep pushing new view controllers in this navigation controller, the tab bar wont hide itself.
However if you present some view controller modally, it would hide itself.
As far as login is concerned, i will check if user has logged in or not. if no, then i would set the root view controller of navigation controller as loginviewconroller else some home page.
I would check the if the user is logged in in the first viewController that get loaded.
From there I would present the loginViewController via the presentModalViewController method.
The use will not see the tabbar if you set the withAnimation:NO.
Now just dismiss the login viewcontroller when the use is logged in.
One could also send a notification that the is logged in, so that viewcontrollers can update them self for the no logged in user.
Any one know how to create an app in such a way that when the application loads the uitabbr items are not selected(highlighted)..
need to display a view in window on load..no need to display tabbar item contents until click on tabbar button item..?
please help me..
You can present a modal view controller which hides the tab bar at startup. I think that's the best you can do with tab bar rules.
I am working on an application that requires user authentication to access a profile. The profile section is located solely under one tab (and all others tabs do not require authentication). I currently present a authentication view controller modally (and then dismiss on success) when the user selects the profile tab. However, this approach prevents the user from deciding not to register / login (that is, all tabs are hidden once the authentication screen is presented modally). I don't want the user to be able to dismiss the modal view controller, but rather have it modal only for the profile tab. Is this possible? Can I have tabs visible while having a modal view controller? What is the best approach here. Thanks.
The entire point of a modal dialog box or view controller is to force the user to look at or do whatever the modal view is requesting, and prevent them from doing something else with that application. It seems to me that the best approach, if you still want to use a modal view controller, would simply be to have a "Cancel" button or something on the view controller. Since the profile tab can only be accessed after authentication in the first place, just have dismissing the view controller make the last-viewed tab the active tab.
Xcode 10:
In the Attributes Inspector, inside View Controller section, you've the Presentation option.
a) If you choose Over Current Context, the modal view just will appear over the view, but the Tab Bar will appear at the top of the view.
b) Otherwise, if you choose Over Full Screen, the modal view will appears over all the UI, including tab bars.