Skip to content

Commit

Permalink
minor update & refine;
Browse files Browse the repository at this point in the history
adaptive refine;

add new property descriptionTextColor
  • Loading branch information
liu044100 committed Jun 13, 2015
1 parent 94a861b commit 93861ca
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 233 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ EXTERNAL SOURCES:
:path: "~/Documents/developer_learning/Security/SmileTouchID"

SPEC CHECKSUMS:
SmileTouchID: 311a9b3713b4fea994fe2bfbba0d806cb6a04186
SmileTouchID: 2942045b43b7a912e74e062382f44945cfe37fee

COCOAPODS: 0.37.2
3 changes: 3 additions & 0 deletions Example/Pods/Local Podspecs/SmileTouchID.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

458 changes: 244 additions & 214 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 27 additions & 10 deletions Example/TouchID/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[SmileAuthenticator sharedInstance].navibarTranslucent = YES;
[SmileAuthenticator sharedInstance].backgroundImage = [UIImage imageNamed:@"backgroundImage"];

//uncomment it, if you want to see night mode
/*
[SmileAuthenticator sharedInstance].passcodeDigit = 6;
[SmileAuthenticator sharedInstance].tintColor = [UIColor purpleColor];
[SmileAuthenticator sharedInstance].touchIDIconName = @"my_Touch_ID";
[SmileAuthenticator sharedInstance].appLogoName = @"my_Logo";
[SmileAuthenticator sharedInstance].navibarTranslucent = YES;
[SmileAuthenticator sharedInstance].nightMode = YES;
[SmileAuthenticator sharedInstance].backgroundImage = [UIImage imageNamed:@"nightMode_BG"];
*/

return YES;
}
Expand All @@ -68,4 +58,31 @@ - (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

-(void)SMILE_testHelperMethod{
BOOL isCustomize = YES;

if (isCustomize) {

BOOL nightMode = NO;

if (!nightMode) {
//customize
[SmileAuthenticator sharedInstance].passcodeDigit = 6;
[SmileAuthenticator sharedInstance].tintColor = [UIColor purpleColor];
[SmileAuthenticator sharedInstance].touchIDIconName = @"my_Touch_ID";
[SmileAuthenticator sharedInstance].appLogoName = @"my_Logo";
[SmileAuthenticator sharedInstance].navibarTranslucent = YES;
[SmileAuthenticator sharedInstance].backgroundImage = [UIImage imageNamed:@"backgroundImage"];
} else {
[SmileAuthenticator sharedInstance].passcodeDigit = 6;
[SmileAuthenticator sharedInstance].tintColor = [UIColor purpleColor];
[SmileAuthenticator sharedInstance].touchIDIconName = @"my_Touch_ID";
[SmileAuthenticator sharedInstance].appLogoName = @"my_Logo";
[SmileAuthenticator sharedInstance].navibarTranslucent = NO;
[SmileAuthenticator sharedInstance].nightMode = YES;
[SmileAuthenticator sharedInstance].backgroundImage = [UIImage imageNamed:@"nightMode_BG"];
}
}
}

@end
9 changes: 6 additions & 3 deletions SmileAuth/Assets/SmileSettingVC.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="B8P-73-vvD">
<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="B8P-73-vvD">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<scenes>
<!--Smile SettingVC-->
Expand All @@ -20,7 +21,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
</imageView>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LL4-ty-FlL">
<rect key="frame" x="285" y="217" width="30" height="34"/>
<rect key="frame" x="285" y="202" width="30" height="34"/>
<state key="normal">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
Expand All @@ -43,6 +44,7 @@
<variation key="default">
<mask key="constraints">
<exclude reference="dz0-v9-nJl"/>
<exclude reference="hXF-6p-GpM"/>
</mask>
</variation>
</view>
Expand All @@ -60,6 +62,7 @@
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="cLX-BN-r5x" firstAttribute="height" secondItem="Vt2-N3-pA6" secondAttribute="height" multiplier="0.1" id="0vu-Vl-ut8"/>
<constraint firstItem="pQ0-3p-zCf" firstAttribute="top" secondItem="P1b-xr-dK8" secondAttribute="bottom" id="1tX-gW-9nh"/>
<constraint firstItem="cLX-BN-r5x" firstAttribute="top" secondItem="mHp-ZT-N3c" secondAttribute="bottom" constant="20" id="Hvh-Xc-Ur8"/>
<constraint firstItem="cLX-BN-r5x" firstAttribute="leading" secondItem="Vt2-N3-pA6" secondAttribute="leading" id="JuH-1s-JMd"/>
Expand All @@ -73,7 +76,7 @@
<constraint firstItem="F9q-Ek-qul" firstAttribute="top" secondItem="Vt2-N3-pA6" secondAttribute="top" id="kKB-Ih-D5f"/>
<constraint firstItem="mHp-ZT-N3c" firstAttribute="leading" secondItem="Vt2-N3-pA6" secondAttribute="leading" id="qE1-td-lDE"/>
<constraint firstAttribute="trailing" secondItem="mHp-ZT-N3c" secondAttribute="trailing" id="uPP-hC-vb3"/>
<constraint firstItem="LL4-ty-FlL" firstAttribute="top" secondItem="cLX-BN-r5x" secondAttribute="bottom" constant="35" id="yPs-nZ-GLa"/>
<constraint firstItem="LL4-ty-FlL" firstAttribute="top" secondItem="cLX-BN-r5x" secondAttribute="bottom" constant="20" id="yPs-nZ-GLa"/>
<constraint firstItem="pQ0-3p-zCf" firstAttribute="leading" secondItem="Vt2-N3-pA6" secondAttribute="leading" constant="16" id="yfy-4d-pgZ"/>
</constraints>
</view>
Expand Down
2 changes: 2 additions & 0 deletions SmileAuth/Classes/SmileAuthenticator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ typedef NS_ENUM(int, SecurityType) {
@property (nonatomic, weak) id <AuthenticatorDelegate> delegate;
/*!@brief <b>For customization</b>, use this property to customize tint color. The default color is pink.*/
@property (nonatomic, strong) UIColor *tintColor;
/*!@brief <b>For customization</b>, use this property to customize description label text color. The default color is black, if nightMode on, the color is white.*/
@property (nonatomic, strong) UIColor *descriptionTextColor;
/*!@brief <b>For customization</b>, use this property to customize Touch ID icon. The default icon is the Apple official pink Touch ID icon.*/
@property (nonatomic, strong) NSString *touchIDIconName;
/*!@brief <b>For customization</b>, use this property to set the app logo to UI.*/
Expand Down
3 changes: 2 additions & 1 deletion SmileAuth/Classes/SmileAuthenticator.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ +(BOOL)hasPassword {
}

+(BOOL)isSamePassword:(NSString *)userInput{

//use this line to log password, if you forgot it.
// NSLog(@"the password -> %@", [[SmileAuthenticator sharedInstance].keychainWrapper myObjectForKey:kKeyChainObjectKey]);
if ([userInput isEqualToString:[[SmileAuthenticator sharedInstance].keychainWrapper myObjectForKey:kKeyChainObjectKey]]) {
return YES;
}
Expand Down
6 changes: 5 additions & 1 deletion SmileAuth/Classes/SmileSettingVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ - (void)viewDidLoad {
[self.navigationController.navigationBar setBarStyle:UIBarStyleBlack];
[self.passwordField setKeyboardAppearance:UIKeyboardAppearanceDark];
self.view.backgroundColor = [UIColor blackColor];
self.descLabel.textColor = [UIColor whiteColor];
}


if ([SmileAuthenticator sharedInstance].descriptionTextColor) {
self.descLabel.textColor = [SmileAuthenticator sharedInstance].descriptionTextColor;
}

if ([SmileAuthenticator sharedInstance].backgroundImage) {
self.bgImageView.image = [SmileAuthenticator sharedInstance].backgroundImage;
}
Expand Down
3 changes: 2 additions & 1 deletion SmileTouchID.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SmileTouchID"
s.version = "0.0.7"
s.version = "0.0.8"
s.summary = "A Library for configure Touch ID & passcode conveniently"
s.description = <<-DESC
1. Handle all complicated things about Touch ID & Passcode. You just need to write a few simple code to integrate Touch ID & Passcode to your app.
Expand All @@ -22,6 +22,7 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.source = { :git => "https://github.com/liu044100/SmileTouchID.git", :tag => s.version.to_s}
s.source_files = 'SmileAuth/Classes/*'
s.resource = ['SmileAuth/Assets/*']
s.public_header_files = 'SmileAuth/Classes/*.h'
s.frameworks = 'UIKit'
s.weak_framework = 'LocalAuthentication'
Expand Down

0 comments on commit 93861ca

Please sign in to comment.