DKAuthenticationViewController 0.2.1

DKAuthenticationViewController 0.2.1

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2015年10月

Daniel Khamsing维护。



DKAuthenticationViewController 是一个简单的身份验证视图控制器,用于 iOS,可以采用电子邮件、密码或 Twitter(系统帐户选择器)进行身份验证。

安装

手动

将DKAuthenticationViewController文件夹中的文件添加到项目中。

使用

    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 有两个属性,使用协议解耦功能

要使用协议,只需创建一个符合该协议的对象(实现其方法)并将其赋给 DKAuthenticationViewController 实例的属性(对于 DKHudProtocol,您将创建一个实现 - hideInView:animationDuration- showInView:animationDuration 的对象)。

示例

DKAuthenticationViewController 包括一个示例项目。

依赖项

DKAuthenticationViewController 使用 Apple 的 Accounts 框架和 DKTwitterReverseAuth 进行 Twitter 反向身份验证。

联系

许可证

DKAuthenticationViewController 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。