Skip to content

Commit

Permalink
优化调整了部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtzepanc committed Jun 21, 2017
1 parent 12c4448 commit 666798b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion PCGestureUnlock/FrameWork/PCCircle.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)drawRect:(CGRect)rect {

if (self.type == CircleTypeGesture) {
radio = CircleRadio;
} else if (self.type == CircleTypeInfo) {
} else {
radio = 1;
}

Expand Down
10 changes: 5 additions & 5 deletions PCGestureUnlock/FrameWork/PCCircleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ -(void)calAngleAndconnectTheJumpedCircle{
#pragma mark - 提供两个点,返回一个它们的中点
- (CGPoint)centerPointWithPointOne:(CGPoint)pointOne pointTwo:(CGPoint)pointTwo
{
CGFloat x1 = pointOne.x > pointTwo.x ? pointOne.x : pointTwo.x;
CGFloat x2 = pointOne.x < pointTwo.x ? pointOne.x : pointTwo.x;
CGFloat y1 = pointOne.y > pointTwo.y ? pointOne.y : pointTwo.y;
CGFloat y2 = pointOne.y < pointTwo.y ? pointOne.y : pointTwo.y;
CGFloat x1 = fmax(pointOne.x, pointTwo.x);
CGFloat x2 = fmin(pointOne.x, pointTwo.x);
CGFloat y1 = fmax(pointOne.y, pointTwo.y);
CGFloat y2 = fmin(pointOne.y, pointTwo.y);

return CGPointMake((x1+x2)/2, (y1 + y2)/2);
}

Expand Down
6 changes: 3 additions & 3 deletions PCGestureUnlock/View/PCCircleInfoView.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation PCCircleInfoView
- (instancetype)init
{
if (self = [super init]) {
// 解锁视图准备
// 解锁视图
[self lockViewPrepare];
}
return self;
Expand All @@ -22,14 +22,14 @@ - (instancetype)init
- (id)initWithCoder:(NSCoder *)aDecoder
{
if (self = [super initWithCoder:aDecoder]) {
// 解锁视图准备
// 解锁视图
[self lockViewPrepare];
}
return self;
}

/*
* 解锁视图准备
* 解锁视图
*/
-(void)lockViewPrepare{

Expand Down
6 changes: 3 additions & 3 deletions PCGestureUnlock/View/PCLockLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
/*
* 普通提示信息
*/
-(void)showNormalMsg:(NSString *)msg;
- (void)showNormalMsg:(NSString *)msg;


/*
* 警示信息
*/
-(void)showWarnMsg:(NSString *)msg;
- (void)showWarnMsg:(NSString *)msg;

/*
* 警示信息(shake)
*/
-(void)showWarnMsgAndShake:(NSString *)msg;
- (void)showWarnMsgAndShake:(NSString *)msg;

@end
12 changes: 6 additions & 6 deletions PCGestureUnlock/View/PCLockLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@implementation PCLockLabel


-(instancetype)initWithFrame:(CGRect)frame{
- (instancetype)initWithFrame:(CGRect)frame{

self = [super initWithFrame:frame];

Expand All @@ -21,7 +21,7 @@ -(instancetype)initWithFrame:(CGRect)frame{



-(id)initWithCoder:(NSCoder *)aDecoder{
- (instancetype)initWithCoder:(NSCoder *)aDecoder{

self=[super initWithCoder:aDecoder];

Expand All @@ -38,7 +38,7 @@ -(id)initWithCoder:(NSCoder *)aDecoder{
/*
* 视图初始化
*/
-(void)viewPrepare{
- (void)viewPrepare{

[self setFont:[UIFont systemFontOfSize:14.0f]];
[self setTextAlignment:NSTextAlignmentCenter];
Expand All @@ -48,7 +48,7 @@ -(void)viewPrepare{
/*
* 普通提示信息
*/
-(void)showNormalMsg:(NSString *)msg{
- (void)showNormalMsg:(NSString *)msg{

[self setText:msg];
[self setTextColor:textColorNormalState];
Expand All @@ -57,7 +57,7 @@ -(void)showNormalMsg:(NSString *)msg{
/*
* 警示信息
*/
-(void)showWarnMsg:(NSString *)msg{
- (void)showWarnMsg:(NSString *)msg{

[self setText:msg];
[self setTextColor:textColorWarningState];
Expand All @@ -66,7 +66,7 @@ -(void)showWarnMsg:(NSString *)msg{
/*
* 警示信息(shake)
*/
-(void)showWarnMsgAndShake:(NSString *)msg{
- (void)showWarnMsgAndShake:(NSString *)msg{

[self setText:msg];
[self setTextColor:textColorWarningState];
Expand Down

0 comments on commit 666798b

Please sign in to comment.