Demo 地址 https://git.oschina.net/19941225/CoreLock.git
1、引入头文件
#import "CLLockVC.h"
2、集成相对应的功能
#pragma mark -- 设置密码
- (IBAction)setPwd:(id)sender
{
BOOL hasPwd = [CLLockVC hasPwd];
hasPwd = NO;
if(hasPwd){
NSLog(@"已经设置过密码了,你可以验证或者修改密码");
}else{
[CLLockVC showSettingLockVCInVC:self successBlock:^(CLLockVC *lockVC, NSString *pwd) {
NSLog(@"密码设置成功");
[lockVC dismiss:1.0f];
}];
}
}
#pragma mark -- 验证密码
- (IBAction)verifyPwd:(id)sender
{
BOOL hasPwd = [CLLockVC hasPwd];
if(!hasPwd){
NSLog(@"你还没有设置密码,请先设置密码");
}else {
[CLLockVC showVerifyLockVCInVC:self forgetPwdBlock:^{
NSLog(@"忘记密码");
} successBlock:^(CLLockVC *lockVC, NSString *pwd) {
NSLog(@"密码正确");
[lockVC dismiss:1.0f];
}];
}
}
#pragma mark -- 修改密码
- (IBAction)modifyPwd:(id)sender
{
BOOL hasPwd = [CLLockVC hasPwd];
if(!hasPwd){
NSLog(@"你还没有设置密码,请先设置密码");
}else {
[CLLockVC showModifyLockVCInVC:self successBlock:^(CLLockVC *lockVC, NSString *pwd) {
[lockVC dismiss:.5f];
}];
}
}