DKAuthenticationViewController 0.2.1

DKAuthenticationViewController 0.2.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2015

Maintained by Daniel Khamsing.



Simple authentication view controller for iOS using email, password or Twitter (system account picker).

Installation

Manual

Add the files in the DKAuthenticationViewController folder to your project.

Usage

    DKAuthenticationViewController *authController = [[DKAuthenticationViewController alloc] init];
    authController.twitter = YES; // Optional
    authController.cellBackgroundColor = [UIColor lightGrayColor]; // Optional
    authController.passwordLength = 5; // Validate password 
    authController.successBlock = ^void(id user, BOOL signup) {
        NSLog(@"User %@ in 😎", signup?@"signed":@"logged");
    };

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:authController];
    [self presentViewController:navigationController animated:YES completion:nil]; // Should be presented modally with a navigation controller

DKAuthenticationViewController has two properties that use protocols to decouple functionality:

To use a protocol, simply create an object that conforms to it (implements its methods) and assign it as a property to your instance of DKAuthenticationViewController (for DKHudProtocol, you would create an object that implements - hideInView:animationDuration and - showInView:animationDuration).

Demo

DKAuthenticationViewController includes a demo project.

Dependencies

DKAuthenticationViewController uses Apple's Accounts framework and DKTwitterReverseAuth for Twitter reverse authentication.

Contact

License

DKAuthenticationViewController is available under the MIT license. See the LICENSE file for more info.