Demo下载地址:http://download.csdn.net/download/u010981736/9948271
效果图:
核心代码:
//
// ClockView.m
// 手势解锁
//
// Created by llkj on 2017/8/24.
// Copyright © 2017年 LayneCheung. All rights reserved.
//
#import "ClockView.h"
@interface ClockView ()
//存放当前选中的按钮
@property (nonatomic, strong) NSMutableArray *selectBtnArry;
//当前手指所在点
@property (nonatomic, assign) CGPoint curP;
@end
@implementation ClockView
- (void)awakeFromNib{
[super awakeFromNib];
//初始化
[self setUp];
}
- (NSMutableArray *)selectBtnArry{
if (_selectBtnArry == nil) {
_selectBtnArry = [NSMutableArray array];
}
return _selectBtnArry;
}
- (void)setUp{
for (int i = 0; i < 9; i ++) {
//创建按钮
UIButton *btn = [UI