Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated from upstream #2

Merged
merged 22 commits into from Jul 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
769ebc7
Merge branch 'release/3.2.0' into develop
Sep 6, 2014
00b6170
Fixed rotation issue on iPhone 6 Plus
Nov 1, 2014
19ad930
Do not ignore appearance for numberLabelFont and letterLabelFont anym…
Feb 24, 2015
95a142f
Increased width of enterPasswordLabel. Added cancelLabelFont appearan…
Feb 24, 2015
63ad4f8
Changed cancelLabelFont into deleteCancelLabelFont and set to deleteL…
Feb 24, 2015
df1a75c
Added pinConfirmationText and pinNotMatchedText properties in ABPadLo…
Feb 25, 2015
c892456
Increased detailLabel and enterPasscodeLabel's width.
Feb 25, 2015
7407f9d
Blur effect for iOS 8
Mar 19, 2015
021e80f
Merge pull request #38 from artnow44/master
abury Apr 16, 2015
2743171
Resolved #32 by calling designated init method.
abury Apr 16, 2015
9f34679
Merge branch 'master' into develop
abury Apr 16, 2015
f360bd0
Merge pull request #35 from MaxHasADHD/master
abury Apr 16, 2015
03c1d4a
Merge branch 'master' into develop
abury Apr 16, 2015
eb693b8
Merge pull request #39 from chitza/master
abury Apr 17, 2015
b392ab9
Merge branch 'master' into develop
abury Apr 17, 2015
4c1dd3f
Updated readme with contribution guidelines
abury Apr 17, 2015
da13739
Merge branch 'release/3.3.0'
abury Apr 17, 2015
77dfb07
Updated pod spec to point to 3.3.0
abury Apr 17, 2015
de7512d
Merge branch 'develop'
abury Apr 17, 2015
85aed94
Replaced missing image in spec file
abury Apr 22, 2015
e38587b
Merge branch 'develop'
abury Apr 22, 2015
cf5fd8a
Merge remote-tracking branch 'upstream/master'
haswalt Jul 6, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ABPadLockScreen.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ABPadLockScreen"
s.version = "3.2.0"
s.version = "3.3.0"
s.summary = "A simple, stylish keypad lock screen for your iPhone or iPad App"

s.description = <<-DESC
Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
DESC

s.homepage = "https://github.com/abury/ABPadLockScreen"
s.screenshots = "http://aronbury.com/assets/images/abpadlockscreen/fb-blue.png", "http://aronbury.com/assets/images/abpadlockscreen/yellow-ipad.png"
s.screenshots = "http://aronbury.com/assets/images/abpadlockscreen/fb-blue.png", "http://aronbury.com/assets/images/abpadlockscreen/custom_red.jpg"

s.license = 'MIT'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
2 changes: 2 additions & 0 deletions ABPadLockScreen/ABPadButton.m
Expand Up @@ -115,8 +115,10 @@ - (void)prepareApperance
self.layer.borderColor = [self.borderColor CGColor];
self.numberLabel.textColor = self.textColor;
self.numberLabel.highlightedTextColor = self.hightlightedTextColor;
self.numberLabel.font = self.numberLabelFont;
self.lettersLabel.textColor = self.textColor;
self.lettersLabel.highlightedTextColor = self.hightlightedTextColor;
self.lettersLabel.font = self.letterLabelFont;
}

- (void)performLayout
Expand Down
1 change: 1 addition & 0 deletions ABPadLockScreen/ABPadLockScreenAbstractViewController.h
Expand Up @@ -49,6 +49,7 @@
- (void)setSubtitleText:(NSString *)text;
- (void)setCancelButtonText:(NSString *)text;
- (void)setDeleteButtonText:(NSString *)text;
- (void)setEnterPasscodeLabelText:(NSString *)text;

- (void)cancelButtonDisabled:(BOOL)disabled;

Expand Down
18 changes: 17 additions & 1 deletion ABPadLockScreen/ABPadLockScreenAbstractViewController.m
Expand Up @@ -70,7 +70,18 @@ - (void)viewDidLoad
{
[super viewDidLoad];

self.view = [[ABPadLockScreenView alloc] initWithFrame:self.view.bounds complexPin:self.isComplexPin];
CGRect bounds = self.view.bounds;
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
if (bounds.size.width > bounds.size.height) {
CGFloat height = bounds.size.width;
CGFloat width = bounds.size.height;
bounds.size.height = height;
bounds.size.width = width;
}
}

self.view = [[ABPadLockScreenView alloc] initWithFrame:bounds complexPin:self.isComplexPin];

[self setUpButtonMapping];
[lockScreenView.cancelButton addTarget:self action:@selector(cancelButtonSelected:) forControlEvents:UIControlEventTouchUpInside];
[lockScreenView.deleteButton addTarget:self action:@selector(deleteButtonSelected:) forControlEvents:UIControlEventTouchUpInside];
Expand Down Expand Up @@ -151,6 +162,11 @@ - (void)setDeleteButtonText:(NSString *)text
[lockScreenView.deleteButton sizeToFit];
}

- (void)setEnterPasscodeLabelText:(NSString *)text
{
lockScreenView.enterPasscodeLabel.text = text;
}

- (void)setBackgroundView:(UIView *)backgroundView
{
[lockScreenView setBackgroundView:backgroundView];
Expand Down
2 changes: 2 additions & 0 deletions ABPadLockScreen/ABPadLockScreenSetupViewController.h
Expand Up @@ -35,6 +35,8 @@

@property (nonatomic, weak, readonly) id<ABPadLockScreenSetupViewControllerDelegate> setupScreenDelegate;
@property (nonatomic, strong, readonly) NSString *subtitleLabelText;
@property (nonatomic, strong) NSString *pinNotMatchedText;
@property (nonatomic, strong) NSString *pinConfirmationText;

- (instancetype)initWithDelegate:(id<ABPadLockScreenSetupViewControllerDelegate>)delegate;
- (instancetype)initWithDelegate:(id<ABPadLockScreenSetupViewControllerDelegate>)delegate complexPin:(BOOL)complexPin;
Expand Down
17 changes: 10 additions & 7 deletions ABPadLockScreen/ABPadLockScreenSetupViewController.m
Expand Up @@ -42,11 +42,7 @@ @implementation ABPadLockScreenSetupViewController
#pragma mark - Init Methods
- (instancetype)initWithDelegate:(id<ABPadLockScreenSetupViewControllerDelegate>)delegate
{
self = [self initWithComplexPin:NO];
if (self)
{
self.delegate = delegate;
}
self = [self initWithDelegate:delegate complexPin:NO];
return self;
}

Expand All @@ -58,6 +54,7 @@ - (instancetype)initWithDelegate:(id<ABPadLockScreenSetupViewControllerDelegate>
self.delegate = delegate;
_setupScreenDelegate = delegate;
_enteredPin = nil;
[self setDefaultTexts];
}
return self;
}
Expand All @@ -75,6 +72,12 @@ - (instancetype)initWithDelegate:(id<ABPadLockScreenSetupViewControllerDelegate>
return self;
}

- (void)setDefaultTexts
{
_pinNotMatchedText = NSLocalizedString(@"Pincode did not match.", @"");
_pinConfirmationText = NSLocalizedString(@"Re-enter your new pincode", @"");
}

#pragma mark -
#pragma mark - View Controller Lifecycle Methods
- (void)viewDidLoad
Expand All @@ -100,7 +103,7 @@ - (void)startPinConfirmation
{
self.enteredPin = self.currentPin;
self.currentPin = @"";
[lockScreenView updateDetailLabelWithString:NSLocalizedString(@"Re-enter your new pincode", @"") animated:YES completion:nil];
[lockScreenView updateDetailLabelWithString:self.pinConfirmationText animated:YES completion:nil];
[lockScreenView resetAnimated:YES];
}

Expand All @@ -115,7 +118,7 @@ - (void)validateConfirmedPin
}
else
{
[lockScreenView updateDetailLabelWithString:NSLocalizedString(@"Pincode did not match.", @"") animated:YES completion:nil];
[lockScreenView updateDetailLabelWithString:self.pinNotMatchedText animated:YES completion:nil];
[lockScreenView animateFailureNotification];
[lockScreenView resetAnimated:YES];
self.enteredPin = nil;
Expand Down
1 change: 1 addition & 0 deletions ABPadLockScreen/ABPadLockScreenView.h
Expand Up @@ -30,6 +30,7 @@

@property (nonatomic, strong) UIFont *enterPasscodeLabelFont UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIFont *detailLabelFont UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIFont *deleteCancelLabelFont UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *labelColor UI_APPEARANCE_SELECTOR;

@property (nonatomic, strong) UIView* backgroundView;
Expand Down
31 changes: 24 additions & 7 deletions ABPadLockScreen/ABPadLockScreenView.m
Expand Up @@ -210,8 +210,11 @@ - (void)updateDetailLabelWithString:(NSString *)string animated:(BOOL)animated c
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1)
labelWidth += [string sizeWithAttributes:@{NSFontAttributeName:self.detailLabelFont}].width;
else
labelWidth += [string sizeWithFont: self.detailLabelFont].width;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
labelWidth += [string sizeWithFont: self.detailLabelFont].width;
#pragma clang diagnostic pop

CATransition *animation = [CATransition animation];
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = kCATransitionFade;
Expand All @@ -222,7 +225,7 @@ - (void)updateDetailLabelWithString:(NSString *)string animated:(BOOL)animated c

CGFloat pinSelectionTop = self.enterPasscodeLabel.frame.origin.y + self.enterPasscodeLabel.frame.size.height + 17.5;

self.detailLabel.frame = CGRectMake(([self correctWidth]/2) - 100, pinSelectionTop + 30, 200, 23);
self.detailLabel.frame = CGRectMake(([self correctWidth]/2) - 150, pinSelectionTop + 30, 300, 23);
}

- (void)lockViewAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion
Expand Down Expand Up @@ -325,7 +328,11 @@ - (void)setBackgroundView:(UIView *)backgroundView
{
if(_backgroundBlurringView == nil)
{
if(NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1)
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) { // iOS 8
UIBlurEffect *blur = [UIBlurEffect effectWithStyle: UIBlurEffectStyleLight];
_backgroundBlurringView = [[UIVisualEffectView alloc] initWithEffect: blur];
}
else if(NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1)
{
_backgroundBlurringView = [[UINavigationBar alloc] initWithFrame:self.bounds];
[(UINavigationBar*)_backgroundBlurringView setBarStyle: UIBarStyleBlack];
Expand All @@ -335,6 +342,7 @@ - (void)setBackgroundView:(UIView *)backgroundView
_backgroundBlurringView = [[UIView alloc] initWithFrame:self.bounds];
_backgroundBlurringView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.75f];
}
_backgroundBlurringView.frame = _contentView.frame;
_backgroundBlurringView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self insertSubview:_backgroundBlurringView belowSubview:_contentView];
}
Expand All @@ -343,7 +351,12 @@ - (void)setBackgroundView:(UIView *)backgroundView

[_backgroundView setFrame:self.bounds];
[_backgroundView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[self insertSubview:_backgroundView belowSubview:_backgroundBlurringView];
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) {
//[_backgroundView addSubview:_backgroundBlurringView];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cocwoc

[self insertSubview:_backgroundView belowSubview:_backgroundBlurringView];
} else {
[self insertSubview:_backgroundView belowSubview:_backgroundBlurringView];
}
}
}

Expand Down Expand Up @@ -371,7 +384,11 @@ - (void)prepareAppearance
self.detailLabel.font = self.detailLabelFont;

[self.cancelButton setTitleColor:self.labelColor forState:UIControlStateNormal];
self.cancelButton.titleLabel.font = self.deleteCancelLabelFont;

[self.deleteButton setTitleColor:self.labelColor forState:UIControlStateNormal];
self.deleteButton.titleLabel.font = self.deleteCancelLabelFont;

[self.okButton setTitleColor:self.labelColor forState:UIControlStateNormal];
}

Expand All @@ -398,7 +415,7 @@ - (void)layoutTitleArea
top = NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1 ? 30 : 80;;
}

self.enterPasscodeLabel.frame = CGRectMake(([self correctWidth]/2) - 100, top, 200, 23);
self.enterPasscodeLabel.frame = CGRectMake(([self correctWidth]/2) - 150, top, 300, 23);
[self.contentView addSubview:self.enterPasscodeLabel];

CGFloat pinSelectionTop = self.enterPasscodeLabel.frame.origin.y + self.enterPasscodeLabel.frame.size.height + 17.5;
Expand Down Expand Up @@ -427,7 +444,7 @@ - (void)layoutTitleArea
}
}

self.detailLabel.frame = CGRectMake(([self correctWidth]/2) - 100, pinSelectionTop + 30, 200, 23);
self.detailLabel.frame = CGRectMake(([self correctWidth]/2) - 150, pinSelectionTop + 30, 300, 23);
[self.contentView addSubview:self.detailLabel];
}

Expand Down
Binary file not shown.
Expand Up @@ -27,10 +27,7 @@ - (void)viewDidLoad
[super viewDidLoad];

self.title = @"Your Amazing App";

//Remove comment to modify the apperance

/*
[[ABPadLockScreenView appearance] setBackgroundColor:[UIColor colorWithHexValue:@"282B35"]];

UIColor* color = [UIColor colorWithRed:229.0f/255.0f green:180.0f/255.0f blue:46.0f/255.0f alpha:1.0f];
Expand All @@ -41,7 +38,6 @@ - (void)viewDidLoad
[[ABPadButton appearance] setSelectedColor:color];

[[ABPinSelectionView appearance] setSelectedColor:color];
*/
}

#pragma mark -
Expand All @@ -55,11 +51,11 @@ - (IBAction)setPin:(id)sender
lockScreen.modalPresentationStyle = UIModalPresentationFullScreen;
lockScreen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

//Example using an image
UIImageView* backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallpaper"]];
backgroundView.contentMode = UIViewContentModeScaleAspectFill;
backgroundView.clipsToBounds = YES;
[lockScreen setBackgroundView:backgroundView];
// Example using an image
// UIImageView* backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallpaper"]];
// backgroundView.contentMode = UIViewContentModeScaleAspectFill;
// backgroundView.clipsToBounds = YES;
// [lockScreen setBackgroundView:backgroundView];

[self presentViewController:lockScreen animated:YES completion:nil];
}
Expand All @@ -78,11 +74,11 @@ - (IBAction)lockApp:(id)sender
lockScreen.modalPresentationStyle = UIModalPresentationFullScreen;
lockScreen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

//Example using an image
UIImageView* backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallpaper"]];
backgroundView.contentMode = UIViewContentModeScaleAspectFill;
backgroundView.clipsToBounds = YES;
[lockScreen setBackgroundView:backgroundView];
// Example using an image
// UIImageView* backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallpaper"]];
// backgroundView.contentMode = UIViewContentModeScaleAspectFill;
// backgroundView.clipsToBounds = YES;
// [lockScreen setBackgroundView:backgroundView];

[self presentViewController:lockScreen animated:YES completion:nil];
}
Expand Down
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -2,7 +2,10 @@
<img src="http://www.aronbury.com/assets/images/ab_logo.png" alt="ABLogo" title="ABLogo">
</p>

[![Twitter: @AronBury](https://img.shields.io/badge/contact-@AronBury-blue.svg?style=flat)](https://twitter.com/AronBury)
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/abury/ABPadLockScreen/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/abury/ABPadLockScreen.png)](https://travis-ci.org/abury/ABPadLockScreen)
![Version](https://img.shields.io/cocoapods/v/ABPadLockScreen.svg)

ABPadLockScreen aims to provide a universal solution to providing a secure keypad/pin lock screen to your iPhone or iPad app. With just a few lines you can have a full lock screen module ready to go.

Expand All @@ -24,7 +27,7 @@ If you have cocoapods setup on your machine, simply set the spec like this:
#### Podfile
```ruby
platform :ios, '6.0'
pod "ABPadLockScreen", "~> 3.1.0"
pod "ABPadLockScreen", "~> 3.3.0"
```
The earliest version of this framework that supports cocoapods is 3.0.0

Expand All @@ -34,5 +37,8 @@ The module is entirely customisable through UIAppearance. All colours and fonts
<img src="http://aronbury.com/assets/images/abpadlockscreen/custom_red.jpg" width=50% alt="Custom Text" title="Custom Text">
<img src="http://www.aronbury.com/assets/images/abpadlockscreen/gray-locked.png" width=50% alt="Locked out" title="Locked out">

## Contributing
I love seeing people contribute to the ABPadLockscreen. It's had some great new features already contributed by some talented folks. If you want to contribute please issue a pull request to the develop branch of this repository. I'll review them and if it looks good we'll merge and push it in the next release!

## License
ABPadLockScreen is available under the MIT license. See the LICENSE file for more info.
ABPadLockScreen is available under the MIT license. See the LICENSE file for more info.