I’m fairly new to iOS development and have an application that requires a login each time you launch the application. Obviously, the default behavior when resuming the application is to return to the last open view. I do want this behavior but I need the user to authenticate first and then return them to the last open view so that they can continue their work. I have seen other applications do this. Can anyone give me a pointer on the best way to implement this?
Share
See UIApplicationDelegate Protocol Reference: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html
This method is called to let your application know that it moved from the inactive to active state. This can occur because your application was launched by the user or the system. Applications can also return to the active state if the user chooses to ignore an interruption (such as an incoming phone call or SMS message) that sent the application temporarily to the inactive state.
You should use this method to restart any tasks that were paused (or not yet started) while the application was inactive. For example, you could use it to restart timers or throttle up OpenGL ES frame rates. If your application was previously in the background, you could also use it to refresh your application’s user interface.
And best way to request login/password is to use UIAlertView … Here is a comp[lete source code of such dialog imlementation: https://github.com/digdog/DDAlertPrompt … You have to insert something like this in your applicationDidBecomeActive: