Application Layout - iphone

my application's layout is:
Tab controller
--> UIViewController1
--> UIViewController2
--> UIViewController3
I need a Login Screen before that, so I show a popup with "presentModalViewController" in the "didFinishLaunching" in app delegate.
But I want a login screen with a nav controller, this:
Login screen:
--> Select REGISTER or LOGIN
-> if REGISTER --> show view for register
-> if LOGIN --> show view for login
So I suppose I need a NavigationController, it's right?
I've readed many questions and one suggest me to create a layout like this:
Navigation Controller
--> Login Screen (with REGISTER or LOGIN) ---> register or login view ---> close view and show tabbar
Which between these ways is more correct?

I would use the navigation controller when they go into the registration section. This would allow the user to step back out after they go in and also allows for some flexibility if your registration process ever needs to be made into multiple steps.
Another suggestion is that you should put the actual log-in form on the first view. This way users that have already registered with you will not have to perform 2 steps just to log-in.
Login Screen
Login Form
Register Button -> Register Views

Related

Login screen shown just once

i'm making app based on tab bar with two tabs. My problem is that i have to implement authentication view "loginView" on one of tabb's view, and when the credentials are saved i want show another data everytime tab is tapped. what's the best way to do it ?
Store a boolean in your user defaults, something like 'loginShown', then, in your appplicationDidFinishLaunching method, check if the 'loginShown' is set, and if not, present a modal view controller which is your login view.
You can use a modalViewController for Login so you can have some other view beneath it. For saving credentials for Login so that the user does not have to log back in, you can store it in the KeyChain.
Use this reference: http://log.scifihifi.com/post/55837387/simple-iphone-keychain-code

Presenting login and registration view

I am working on an app whereby the user will have the login before using the services. How should I do about doing so, considering the user might register for an account through a UIButton on the login page, which will bring the user to registration view.
Can I use presentModalView to show the login view? If so, how do present I the registration view? Upon successful registration, the user will be auto logged in with the newly created account.
You should create a Modal View Controller (Login View Controller) and set that inside a UINavigationController. If you use a Registration UIButton there, you will be able to navigate to the RegistrationViewController and based on the events happening, you can choose to dismissModalViewController.
A detailed explanation on what you are looking for... is provided here - Show / Hide tab bar !!

iphone RootViewController Login or Menu

This is kind of on the back of a previous question. Im currently throwing together a simple social networking iphone. For my question you can think of the application to be quite similar to the facebook iphone app.
It is based off the navigation template and the menu view is the top level view controller for my navigation controller. The user needs to log in to use the application.
Im just wondering whether the navigation controller should be the starting view and if the user has not logged in (when the user logs in I will store the login information so that they do not have to login next time the open the app) than it will throw the login page up modally. Or if the login page should be the startup view and on login the login control will create and go to the navigation control.
Thanks in advance
If the user needs to log in before using the application, then showing the login screen modally is probably the best bet for the first view that gets displayed.
Apple does this with their iTunes Connect app that is available when you go to view your sales data. They show a black screen while the app is loading, modally display the login screen, then dismiss the view to show the guts of the app.
Plus in your case it would be nice to have the navigation controller ready in the background by the time the user login screen gets dismissed (i.e. you could delay it with an activity indicator while readying the view). It would give the impression of a more responsive app

How do I get a login screen on an iPhone app (using tabBarController)?

I am developing a web app (using rails) that I will be launching within a week. I've "jumped the gun" and started working on the iPhone app for the site (I'm new to iPhone development). Using the peepcode iPhone screencasts and the expense/budget demo app from clarkware I've been able to get things going (using ObjectiveResource for iPhone-to-Rails communication). So I'm able to get a tabBarController loading a table with test data populated from my staging server online. Great.
My problem lies in that I need login functionality. The budgets demo app has this nailed but it uses a navigationController. I would like to use a tabBarController (which I'm using currently) to handle the basic functionality of the app.
Here's how I see the app login functionality working when completed:
When a user first runs the iPhone app, the iPhone app will present a login screen (username and password). If a correct username and password is entered the session/user info is saved (preferably to the general/settings app section of the iPhone). The user won't be presented with the login screen again unless the session expires, the user edits the username/password in the general/settings section of the iPhone, or the user deletes the application and reinstalls.
The closest thing to what I have in mind for this process is the Gowalla app.
So I suppose my question is: What is the best way to get a login screen to appear when using a tabBarController? Once I can do this and get authentication taken care of the rest should fall into place.
Please let me know if there's anything I need to clarify - THANK YOU!
-Tony
Do you want to have the tab bar to display at the bottom? Then just put the Login View Controller as the selected tab by setting the selectedViewController or selectedIndex properties of UITabBarController.
Do you want to have the tab bar display at the bottom but not be actionable until they've logged in? Then set a UITabBarDelegate and override the tabBarController:shouldSelectViewController: method to disallow until login has happened.
Do you not want the tab bar to display until login has been entered (personally I would think this is most desireable)? Then either don't show the TabBarController until you're ready, show the Login View Controller instead... or, alternatively, show the Login Controller as a Modal View Controller over the TabBarController and don't allow it to be dismissed until login was successful.
I am new to iPhone programming, but have done C++ coding moons ago. So far I have created everything programmatically rather than use the nib approach.
For what you what to achieve, I would create a main view controller from the app delegate. Then from this main view controller I would create the login view (UIView) that initially displays and seeks the users login credentials. Once validated, your main view contoller can the create and display (or just display if you created it initially) a tab bar controller with the appropriate view controllers for each tab.
So appDelegate -> Main View Controller -> Logon View
-> Tab View Controller + View Controllers
Hope this helps?!
Matthew.

iPhone Login Screen that shows a Table View after logging in the user

I have a navigation based template application, I parse data into table view.
I want to put a login screen before parse the data. I did the login screen and and succeed the login check.
My problem is that when the user presses the button I change the view to the tableview.
what a way should I draw? I want to learn how can i close the tableview screen when the app launched and after pressed the button I want to show the tableview.
If you are using a navigation based template, you could simply push another view on the stack, or you could have the second table view as the first screen, and push the login over the top. pressing on a button to login will pop the login screen off the stack to reveal the main tableview screen.
I have put the login details in the user preferences screen.