How do I make the login screen with the main tabview controller that makes it open the first time the app is opened - ios

Link to image here
This is the view of the screens
I want
I can't link it to the main tab bar controller

Give the nav controller that parents the login screen a storyboard identifier. Next, create a custom UITabBarController subclass and assign it to the Tab Bar Controller. In its viewDidAppear method, check to see if you need to log in. If so, instantiate the login nav controller via its storyboard ID and present it modally.

Set your login screen as initial view controller. You can set view controller as initial view from attribute inspector. When user login's successfully, present your main tab view controller.

Related

Hide tabbar on one viewcontroller Xcode

I have a tabbed application in Xcode. I don't want my user to see the tab bar unless he logs in. My viewcontroller's name is Login
First present the login view controller which handles the input and validation of user credentials.
In case of success, present the tab bar controller either by replacing window root view controller (initially the login controller) or by pushing the tab bar controller on navigation stack (in this case the navigation controller is the initial view controller).

login view controller and main tab bar controller

I have an app that should either show a login page or a main tab bar controller.
What's the best way to set this up? For now I'm starting out with an empty view controller and then either presenting a navigation controller for the login flow, or a tab bar controller for the main app. This means the entire contents of my app live within a modally presented view. Is that bad?
How do most people handle this?
I assume most people set the tab bar as their default view and present a modal login controller above it if necessary. Then when you log in you can just dismiss the login controller and you are back at your tab bar controller.
Your method should work just fine though.

Creating an initial view before displaying views with UITabController

I am creating an app that uses a UITabController with 5 tabs for navigation. Right now my app loads the first tab as the initial view upon app loading.
I want to be able to change that so I have a view that doesn't use my UITabController as the initial view, and once they click the one button on it, it brings them to the First View and displays the TabController.
I thought I'd simply set up a new view, change that one to the initial view controller and have a segue from the button to the TabController, but when I tried that and the view I wanted to with the button loaded first, but when clicking button it said something about needing to set up a NavigationController? Not sure what to do from here.
I think it's best to leave your tab bar controller as the window's root view controller. You can present the initial view controller from the viewDidAppear method of the controller in the first tab, using presentViewController:animated:completion:. Do this with the animated parameter set to NO, and the initial view will be the first thing the user sees. When you're done with that view, just dismiss it, and you'll be back to the first tab's view.

About tab bar using storyboard

I want to create an app using storyboard that has login window and tab bar controller.
So the flow will be upon tapping the login button, the app will be redirected to tab bar controller with its views.
I have done this:
But referring to Apple Documentation: UITabBarController
Because the UITabBarController class inherits from the
UIViewController class, tab bar controllers have their own view that
is accessible through the view property. When deploying a tab bar
interface, you must install this view as the root of your window.
Unlike other view controllers, a tab bar interface should never be
installed as a child of another view controller.
So that means I am not allowed to do so?
In addition:
The 3 views that are referred by my tab bar, then each of them has their own child view again, but the tab bar in the child view is gone. What could be happen? Am I missing something?
What I have done in all my apps that are structured similarly is to have the first view controller check for valid authentication and if that fails, present a login VC. That login VC has a delegate defined that will pass back the user credential after a successful login and then dismisses the modal login VC does whatever.
Here is a sample layout:
The delegate protocol looks like this:
#protocol LoginViewControllerDelegate
-(void)finishedLoadingUserInfo:(UserInfo *)curUser;
#end
Where UserInfo is the model I use for the user information (in my case, NetworkID, FullName, etc).
When the user has successfully authenticated, I fire off that delegate method which is handled in the class that presented it. If you need more detail, I can help - but the process is simple.
You can launch your login screen first from the appDelegate and then setup and launch the tabBarViewController after the login is successful.
An alternative design is to do the following steps:
1. set up your tabBarViewController,
2. disable the tabs,
3. launch your login view controller modally,
4. enable tabViewController tabs
Either of these two approaches should work.

Presenting modal view over partial page curl modal view

I have my main menu embedded in a navigation controller. The settings button performs a modal segue to show my settings page which is half a page shown using the partial page curl.
Now on the settings I have a 'legal' button which I want to just display a full screen UITextView with all my legal stuff.
The problem is, when I display the legal view controller using a modal segue, it displays behind the partial page curl.
If I try using a push segue, it crashes because there is no Navigation controller as the settings is shown modally.
Is there a way to present a modal view over the top of a partial page curl?
Thanks
Best option I can think of is managing all your segues in your initial main menu controller.
For example, you can write a delegate method such that, if the user hits 'legal', you dismiss the modal view (from within your main menu controller's .m) using a delegate method, and then in that same method present a new modal view controller for the settings page (with it's parent being the main menu view controller, which can then have another delegate method to dismiss the legal page and present the settings menu).

Resources