UIKit & graphicsHistorical technical note
GitHub source-code picks, December 25: gesture unlock, a profile SDK and an image carousel
Collects three open-source components for gesture unlocking, a profile page and an infinite image carousel. Download links and selected integration code help readers identify the component that matches an interface requirement.
Historical resources collected by Bison. The listed projects belong to their respective authors.
On this page
"Comprehensive Alipay-style gesture unlock, profile interface integration, infinitely looping image carousel"
Bison
- NO.1 A comprehensive Alipay-style gesture unlock –––Download

Usage is as follows.
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// 解锁界面 默认clip:YES, arrow:YES
PCCircleView *lockView = [[PCCircleView alloc] init];
lockView.delegate = self;
self.lockView = lockView;
[self.view addSubview:lockView];
}
#pragma - mark - circleView - delegate
#pragma mark - circleView - delegate - setting
- (void)circleView:(PCCircleView *)view type:(CircleViewType)type connectCirclesLessThanNeedWithGesture:(NSString *)gesture
{
NSString *gestureOne = [PCCircleViewConst getGestureWithKey:gestureOneSaveKey];
// 看是否存在第一个密码
if ([gestureOne length]) {
NSLog(@"提示再次绘制之前绘制的第一个手势密码");
} else {
NSLog(@"密码长度不合法%@", gesture);
}
}
- (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteSetFirstGesture:(NSString *)gesture
{
NSLog(@"获得第一个手势密码%@", gesture);
// infoView展示对应选中的圆
}
- (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteSetSecondGesture:(NSString *)gesture result:(BOOL)equal
{
NSLog(@"获得第二个手势密码%@",gesture);
if (equal) {
NSLog(@"两次手势匹配!可以进行本地化保存了");
} else {
NSLog(@"两次手势不匹配!");
}
}
#pragma mark - circleView - delegate - login or verify gesture
- (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteLoginGesture:(NSString *)gesture result:(BOOL)equal
{
// 此时的type有两种情况 Login or verify
if (type == CircleViewTypeLogin) {
if (equal) {
NSLog(@"登陆成功!");
} else {
NSLog(@"密码错误!");
}
} else if (type == CircleViewTypeVerify) {
if (equal) {
NSLog(@"验证成功,跳转到设置手势界面");
} else {
NSLog(@"原手势密码输入错误!");
}
}
}- NO.2 Profile interface integration –––Download

Usage is as follows.
Subclass LBPersonalPage_VC.
- (void)viewDidLoad {
[super viewDidLoad];
//头像设置
self.headImageView.image = [UIImage imageNamed:@"myheadimage.jpeg"];
//背景设置
self.imageBG.image = [UIImage imageNamed:@"BG.jpg"];
//昵称设置
self.nameLabel.text = @"BISON";
}
//右边按钮
- (void)rightBtnAction{
NSLog(@"hello-rig");
}
//左边按钮
- (void)leftBtnAction{
NSLog(@"hello-left");
}- NO.3 An infinitely looping image carousel –––Download
This historical illustration is currently unavailable. The original image URL is retained for reference.
Usage is as follows.
Subclass LBPersonalPage_VC.
- (void)viewDidLoad {
[super viewDidLoad];
// 网络加载图片的轮播器
cycleScrollView.imageURLStringsGroup = imagesURLStrings;
// 本地加载图片的轮播器
SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame: imagesGroup:图片数组];
}Recommended reading: An illustrated guide to implementing iOS in-app purchases
Copyright © Bison. Please retain a hyperlink to the original article when reproducing it.