lundi 11 mai 2015

IOS & objective C development - how to make the login page appear to the user?

I am in my first days of IOS app development, I am trying to build an authentication system for an already existent iOS App using Objective C.

The app's rootviewcontroller is a tabsview followed by navigationControllers.

What i've done so far:

1- creating the loginviewController class & designing it's UI in the storyboard

2- the same thing for the "registration" & "recover my password" classes

3- linking the root viewcontroller with the login page with a segue of type modal.

4- linking the login page with the registration & recover my password pages with segues of type push.

Now i don't know the steps that i should follow to make the login page appear to the user when he first enters the app & eventually store his state so he can access the app later without having to enter his credentials every time (unless he logs out).

Any help is greatly appreciated, thank you

I am available for any clarifications or eventually some screenshots/source code if needed.

Edit 1 : this is the content of my didFinishLaunchingWithOptions method in my appdelegate.m :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    TabsViewController *controller = (TabsViewController *)self.window.rootViewController;


    controller.managedObjectContext = self.managedObjectContext;
    _observer = [[MyStoreObserver alloc] init];
    [[SKPaymentQueue defaultQueue] addTransactionObserver:_observer];

    //Create sub directories in doesn'n exist
    NSString *documentsDirectory =[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
    NSString *pathToFile = [documentsDirectory stringByAppendingString:@"export"];
    BOOL isDir = YES;
    BOOL isFile = [[NSFileManager defaultManager] fileExistsAtPath:pathToFile isDirectory:&isDir];

    if(isFile)
    {
        //it is a file, process it here how ever you like, check isDir to see if its a directory
    }
    else
    {
        [self createSubDirectories];
        //not a file, this is an error, handle it!
    }


    return YES;
}

What should I add/change ??

Aucun commentaire:

Enregistrer un commentaire