Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions PinPadExample/PinPad/PPCircleButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ - (id)initWithFrame:(CGRect)frame
}


-(void) willMoveToSuperview:(UIView *)newSuperview{
self.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5].CGColor;
}

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.

Expand All @@ -28,18 +32,22 @@ - (void)drawRect:(CGRect)rect
// Drawing code
[super drawRect:rect];
[self.layer setCornerRadius:CGRectGetHeight(rect)/2.0];
self.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5].CGColor;
self.layer.borderWidth = 2.0f;
self.layer.borderWidth = 1.7f;
self.layer.masksToBounds = YES;
}

- (void)setHighlighted:(BOOL)highlighted {

if(highlighted) {
self.layer.borderColor = [self titleColorForState:UIControlStateHighlighted].CGColor;
self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5];
self.layer.borderColor = [UIColor clearColor].CGColor;
}
else {
self.backgroundColor = [UIColor clearColor];
self.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5].CGColor;
}

}


@end
2 changes: 2 additions & 0 deletions PinPadExample/PinPad/PPPinPadViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
__weak IBOutlet UIImageView *backgroundImageView;
__weak IBOutlet UIButton *resetButton;
__weak IBOutlet UIButton *cancelButton;
__weak IBOutlet UIView *_pinContainer;
__weak IBOutlet UIView *_numPadContainer;
NSMutableString *_inputPin;
NSMutableArray *_circleViewList;
}
Expand Down
14 changes: 14 additions & 0 deletions PinPadExample/PinPad/PPPinPadViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


#define PP_SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define PP_IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define PP_IS_IPHONE_5 (PP_IS_IPHONE && ([[UIScreen mainScreen] bounds].size.height > 480.0))


typedef NS_ENUM(NSInteger, settingNewPinState) {
Expand Down Expand Up @@ -56,6 +58,18 @@ - (void)viewDidLoad
self.view.backgroundColor = self.backgroundColor;
}

if (!PP_SYSTEM_VERSION_GREATER_THAN(@"6.9")) {
CGRect frame = _pinContainer.frame;
frame.origin.y += 20;
_pinContainer.frame = frame;
}

if (!PP_IS_IPHONE_5) {
CGRect frame = _numPadContainer.frame;
frame.size.height -= 50;
_numPadContainer.frame = frame;
}


}

Expand Down
Loading