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).
Add the files in the DKAuthenticationViewController folder to your project.
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:
hud
property uses the DKHudProtocol
to display a loading spinnerauthentication
property uses the DKAuthenticationProtocol
to login, sign up, logout, etc...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
).
DKAuthenticationViewController includes a demo project.
DKAuthenticationViewController uses Apple's Accounts framework and DKTwitterReverseAuth for Twitter reverse authentication.
DKAuthenticationViewController is available under the MIT license. See the LICENSE file for more info.