I need to add a screen to capture username and password before loading the first view of an app on an iPhone. The whole app is coded and working except for this (late) addition. This is my first app in Xcode so I am not very familiar with the system at all.
I have a LoginViewController set up, but don’t know how to add it to the front of the app so that it loads first and then loads my RootViewController afterwards (I need the login details before loading the next view).
The header of my appdelegate is presently
#import <UIKit/UIKit.h>
@class RootViewController;
@interface Online_HW_DiaryAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
RootViewController *viewController;
UINavigationController *navigationController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) IBOutlet RootViewController *viewController;
@end
but I’m not sure what I need to modify – or indeed what else will need to be modified? Any advice gratefully appreciated.
I think the fastest path is this: In viewDidAppear of RootViewController, detect the login needed condition and present a new LoginVC modally.
The LoginVC, upon determining that the user has logged in successfully, can dismiss itself.