- Release 0.1.1
This commit is contained in:
parent
f9defb409f
commit
af1ec1b884
2
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
2
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
@ -68,7 +68,7 @@
|
||||
66A27898E989A3FA5C15AA671C4536F0 /* EXPMatchers+beIdenticalTo.m in Sources */ = {isa = PBXBuildFile; fileRef = 760BA7B5F09D477F128F7CD8D3AB7FF2 /* EXPMatchers+beIdenticalTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
67459AD239EF669A365519E06B45DCFE /* EXPExpect.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F63B0FF272D1EB750D82F3EADA2D2CA /* EXPExpect.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6846FE121C4A950100FD46A7 /* StrongestPasswordValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 6846FE101C4A950100FD46A7 /* StrongestPasswordValidator.h */; };
|
||||
6846FE131C4A950100FD46A7 /* StrongestPasswordValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 6846FE101C4A950100FD46A7 /* StrongestPasswordValidator.h */; };
|
||||
6846FE131C4A950100FD46A7 /* StrongestPasswordValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 6846FE101C4A950100FD46A7 /* StrongestPasswordValidator.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6846FE141C4A950100FD46A7 /* StrongestPasswordValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6846FE111C4A950100FD46A7 /* StrongestPasswordValidator.m */; };
|
||||
6846FE151C4A950100FD46A7 /* StrongestPasswordValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6846FE111C4A950100FD46A7 /* StrongestPasswordValidator.m */; };
|
||||
6846FE161C4A950100FD46A7 /* StrongestPasswordValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6846FE111C4A950100FD46A7 /* StrongestPasswordValidator.m */; };
|
||||
|
||||
@ -467,7 +467,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@ -500,7 +500,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<!--Strongest Password Validator View Controller-->
|
||||
<scene sceneID="wQg-tq-qST">
|
||||
<objects>
|
||||
<viewController id="whP-gf-Uak" customClass="StrongestPasswordValidatorViewController" sceneMemberID="viewController">
|
||||
@ -16,8 +16,44 @@
|
||||
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OtO-mQ-SUW">
|
||||
<rect key="frame" x="163" y="299" width="273" height="2"/>
|
||||
</progressView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" preservesSuperviewLayoutMargins="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Odb-Xu-Nvo">
|
||||
<rect key="frame" x="163" y="310" width="273" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="273" id="Vy3-V6-EJW"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Csp-5e-4k1">
|
||||
<rect key="frame" x="163" y="211" width="273" height="30"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" enablesReturnKeyAutomatically="YES"/>
|
||||
<connections>
|
||||
<action selector="change:" destination="whP-gf-Uak" eventType="editingChanged" id="AMt-sO-h1A"/>
|
||||
<outlet property="delegate" destination="whP-gf-Uak" id="QRd-l8-IQb"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Odb-Xu-Nvo" firstAttribute="centerX" secondItem="TpU-gO-2f1" secondAttribute="centerX" id="Vt5-Gb-gro"/>
|
||||
<constraint firstItem="Mvr-aV-6Um" firstAttribute="top" secondItem="Odb-Xu-Nvo" secondAttribute="bottom" constant="246" id="bvW-ba-r8V"/>
|
||||
<constraint firstItem="OtO-mQ-SUW" firstAttribute="centerX" secondItem="TpU-gO-2f1" secondAttribute="centerX" id="f01-p6-F1k"/>
|
||||
<constraint firstItem="Odb-Xu-Nvo" firstAttribute="leading" secondItem="Csp-5e-4k1" secondAttribute="leading" id="v9c-tP-FqQ"/>
|
||||
<constraint firstItem="Odb-Xu-Nvo" firstAttribute="trailing" secondItem="Csp-5e-4k1" secondAttribute="trailing" id="y5J-UJ-tPj"/>
|
||||
<constraint firstItem="Csp-5e-4k1" firstAttribute="centerY" secondItem="TpU-gO-2f1" secondAttribute="centerY" constant="-74" id="zGS-n3-jh6"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="passwordTextfield" destination="Csp-5e-4k1" id="3sr-aY-W8V"/>
|
||||
<outlet property="strenghtLabel" destination="Odb-Xu-Nvo" id="NIF-Zd-kdI"/>
|
||||
<outlet property="strenghtProgress" destination="OtO-mQ-SUW" id="bBC-Qg-C6J"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
// Override point for customization after application launch.
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@ -7,8 +7,15 @@
|
||||
//
|
||||
|
||||
#import "StrongestPasswordValidatorViewController.h"
|
||||
#import "StrongestPasswordValidator.h"
|
||||
|
||||
@interface StrongestPasswordValidatorViewController () <UITextFieldDelegate>
|
||||
|
||||
@property (nonatomic, strong) StrongestPasswordValidator *validator;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *strenghtLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIProgressView *strenghtProgress;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordTextfield;
|
||||
|
||||
@interface StrongestPasswordValidatorViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@ -18,6 +25,7 @@
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
_validator = [StrongestPasswordValidator sharedInstance];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
@ -26,4 +34,28 @@
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (IBAction)change:(id)sender {
|
||||
|
||||
[_validator checkPasswordStrength:[_passwordTextfield text] withBlock:^(UIColor * _Nonnull color, PasswordStrengthType strenghtType) {
|
||||
switch (strenghtType) {
|
||||
case PasswordStrengthTypeWeak: {
|
||||
[_strenghtProgress setProgress:0.33];
|
||||
[_strenghtLabel setText:@"Weak"];
|
||||
break;
|
||||
}
|
||||
case PasswordStrengthTypeModerate: {
|
||||
[_strenghtProgress setProgress:0.66];
|
||||
[_strenghtLabel setText:@"Moderate"];
|
||||
break;
|
||||
}
|
||||
case PasswordStrengthTypeStrong: {
|
||||
[_strenghtProgress setProgress:1];
|
||||
[_strenghtLabel setText:@"Strongsd"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
[_strenghtProgress setTintColor:color];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -20,7 +20,7 @@ typedef NS_ENUM(NSInteger, PasswordStrengthType) {
|
||||
|
||||
- (void) setColor:(UIColor * _Nonnull) color forPasswordStrenghtType:(PasswordStrengthType) strenghtType;
|
||||
|
||||
- (void)checkPasswordStrength:(NSString * _Nonnull )password withBlock:(id _Nonnull) object inBackGroundWithBlock:(nullable void (^)(UIColor * _Nonnull color, PasswordStrengthType strenghtType)) responseBlock;
|
||||
- (void)checkPasswordStrength:(NSString * _Nonnull )password withBlock:(nullable void (^)(UIColor * _Nonnull color, PasswordStrengthType strenghtType)) responseBlock;
|
||||
|
||||
- (PasswordStrengthType)checkPasswordStrength:(NSString * _Nonnull)password;
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ static bool isFirstAccess = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)checkPasswordStrength:(NSString * _Nonnull )password withBlock:(id _Nonnull) object inBackGroundWithBlock:(nullable void (^)(UIColor * _Nonnull color, PasswordStrengthType strenghtType)) responseBlock; {
|
||||
- (void)checkPasswordStrength:(NSString * _Nonnull )password withBlock:(nullable void (^)(UIColor * _Nonnull color, PasswordStrengthType strenghtType)) responseBlock; {
|
||||
|
||||
if (responseBlock) {
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "StrongestPasswordValidator"
|
||||
s.version = "0.1.0"
|
||||
s.version = "0.1.1"
|
||||
s.summary = "StrongestPasswordValidator."
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user