Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.

Commit 1ba3afb

Browse files
author
MAXIM KOLESNIK
committed
#fix SCPinAppearance touchIDButton set Enabled #3
#fix Swift pod usage #2
1 parent 9f27def commit 1ba3afb

File tree

5 files changed

+100
-78
lines changed

5 files changed

+100
-78
lines changed

SCPinViewController.podspec

100755100644
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'SCPinViewController'
3-
s.version = '1.0.0'
3+
s.version = '1.0.1'
44
s.license = 'MIT'
55
s.summary = 'Super customization pin code validator'
66
s.homepage = 'https://github.com/SugarAndCandy/SCPinViewController.git'
@@ -13,7 +13,9 @@ Pod::Spec.new do |s|
1313

1414
s.public_header_files = 'SCPinViewController/**/SC*.h'
1515
s.source_files = 'SCPinViewController/**/SC*.{m,h}'
16-
s.resource_bundles = {
17-
'SCPinViewControllerBudle' => ['SCPinViewController/**/*.{png}','SCPinViewController/**/*.{xib}']
18-
}
16+
#s.resource_bundles = {
17+
# 'SCPinViewController' => ['SCPinViewController/**/*.{png}']
18+
#}
19+
s.resources = ['SCPinViewController/**/*.{xib}','SCPinViewController/**/*.{png}']
20+
1921
end

SCPinViewController.xcodeproj/project.pbxproj

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
942AA3A01D396E1A008E39F9 /* SCPinViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 942AA39E1D396E1A008E39F9 /* SCPinViewController.m */; };
1717
942AA3A11D396E1A008E39F9 /* SCPinViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 942AA39F1D396E1A008E39F9 /* SCPinViewController.xib */; };
1818
942AA3A41D397141008E39F9 /* SCPinButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 942AA3A31D397141008E39F9 /* SCPinButton.m */; };
19-
944E83321D3987B3004A565E /* sc_img_touchid.png in Resources */ = {isa = PBXBuildFile; fileRef = 944E832F1D3987B3004A565E /* sc_img_touchid.png */; };
20-
944E83331D3987B3004A565E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 944E83301D3987B3004A565E /* [email protected] */; };
21-
944E83341D3987B3004A565E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 944E83311D3987B3004A565E /* [email protected] */; };
19+
9471BF4A1E046F8E00DE5C51 /* sc_img_delete.png in Resources */ = {isa = PBXBuildFile; fileRef = 9471BF441E046F8E00DE5C51 /* sc_img_delete.png */; };
20+
9471BF4B1E046F8E00DE5C51 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 9471BF451E046F8E00DE5C51 /* [email protected] */; };
21+
9471BF4C1E046F8E00DE5C51 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 9471BF461E046F8E00DE5C51 /* [email protected] */; };
22+
9471BF4D1E046F8E00DE5C51 /* sc_img_touchid.png in Resources */ = {isa = PBXBuildFile; fileRef = 9471BF471E046F8E00DE5C51 /* sc_img_touchid.png */; };
23+
9471BF4E1E046F8E00DE5C51 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 9471BF481E046F8E00DE5C51 /* [email protected] */; };
24+
9471BF4F1E046F8E00DE5C51 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 9471BF491E046F8E00DE5C51 /* [email protected] */; };
2225
94AF9D621D3A2BC800C9B7E0 /* SCPinView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94AF9D611D3A2BC800C9B7E0 /* SCPinView.m */; };
23-
94AF9D811D3A6B8600C9B7E0 /* sc_img_delete.png in Resources */ = {isa = PBXBuildFile; fileRef = 94AF9D7E1D3A6B8600C9B7E0 /* sc_img_delete.png */; };
24-
94AF9D821D3A6B8600C9B7E0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 94AF9D7F1D3A6B8600C9B7E0 /* [email protected] */; };
25-
94AF9D831D3A6B8600C9B7E0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 94AF9D801D3A6B8600C9B7E0 /* [email protected] */; };
2626
94AF9D871D3A94A400C9B7E0 /* SCPinAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 94AF9D861D3A94A400C9B7E0 /* SCPinAppearance.m */; };
2727
/* End PBXBuildFile section */
2828

@@ -42,14 +42,14 @@
4242
942AA39F1D396E1A008E39F9 /* SCPinViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SCPinViewController.xib; sourceTree = "<group>"; };
4343
942AA3A21D397141008E39F9 /* SCPinButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCPinButton.h; sourceTree = "<group>"; };
4444
942AA3A31D397141008E39F9 /* SCPinButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCPinButton.m; sourceTree = "<group>"; };
45-
944E832F1D3987B3004A565E /* sc_img_touchid.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sc_img_touchid.png; sourceTree = "<group>"; };
46-
944E83301D3987B3004A565E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
47-
944E83311D3987B3004A565E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
45+
9471BF441E046F8E00DE5C51 /* sc_img_delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sc_img_delete.png; sourceTree = "<group>"; };
46+
9471BF451E046F8E00DE5C51 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
47+
9471BF461E046F8E00DE5C51 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
48+
9471BF471E046F8E00DE5C51 /* sc_img_touchid.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sc_img_touchid.png; sourceTree = "<group>"; };
49+
9471BF481E046F8E00DE5C51 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
50+
9471BF491E046F8E00DE5C51 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
4851
94AF9D601D3A2BC800C9B7E0 /* SCPinView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCPinView.h; sourceTree = "<group>"; };
4952
94AF9D611D3A2BC800C9B7E0 /* SCPinView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCPinView.m; sourceTree = "<group>"; };
50-
94AF9D7E1D3A6B8600C9B7E0 /* sc_img_delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sc_img_delete.png; sourceTree = "<group>"; };
51-
94AF9D7F1D3A6B8600C9B7E0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
52-
94AF9D801D3A6B8600C9B7E0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
5353
94AF9D851D3A94A400C9B7E0 /* SCPinAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCPinAppearance.h; sourceTree = "<group>"; };
5454
94AF9D861D3A94A400C9B7E0 /* SCPinAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCPinAppearance.m; sourceTree = "<group>"; };
5555
/* End PBXFileReference section */
@@ -122,12 +122,12 @@
122122
944E832E1D3987AA004A565E /* images */ = {
123123
isa = PBXGroup;
124124
children = (
125-
94AF9D7E1D3A6B8600C9B7E0 /* sc_img_delete.png */,
126-
94AF9D7F1D3A6B8600C9B7E0 /* [email protected] */,
127-
94AF9D801D3A6B8600C9B7E0 /* [email protected] */,
128-
944E832F1D3987B3004A565E /* sc_img_touchid.png */,
129-
944E83301D3987B3004A565E /* [email protected] */,
130-
944E83311D3987B3004A565E /* [email protected] */,
125+
9471BF441E046F8E00DE5C51 /* sc_img_delete.png */,
126+
9471BF451E046F8E00DE5C51 /* [email protected] */,
127+
9471BF461E046F8E00DE5C51 /* [email protected] */,
128+
9471BF471E046F8E00DE5C51 /* sc_img_touchid.png */,
129+
9471BF481E046F8E00DE5C51 /* [email protected] */,
130+
9471BF491E046F8E00DE5C51 /* [email protected] */,
131131
);
132132
path = images;
133133
sourceTree = "<group>";
@@ -226,15 +226,15 @@
226226
isa = PBXResourcesBuildPhase;
227227
buildActionMask = 2147483647;
228228
files = (
229-
94AF9D811D3A6B8600C9B7E0 /* sc_img_delete.png in Resources */,
229+
9471BF4A1E046F8E00DE5C51 /* sc_img_delete.png in Resources */,
230+
9471BF4D1E046F8E00DE5C51 /* sc_img_touchid.png in Resources */,
230231
942AA3A11D396E1A008E39F9 /* SCPinViewController.xib in Resources */,
231-
944E83331D3987B3004A565E /* [email protected] in Resources */,
232+
9471BF4E1E046F8E00DE5C51 /* [email protected] in Resources */,
232233
942AA3951D396DE8008E39F9 /* LaunchScreen.storyboard in Resources */,
233-
94AF9D821D3A6B8600C9B7E0 /* [email protected] in Resources */,
234234
942AA3921D396DE8008E39F9 /* Assets.xcassets in Resources */,
235-
94AF9D831D3A6B8600C9B7E0 /* sc_img_delete@3x.png in Resources */,
236-
944E83341D3987B3004A565E /* [email protected] in Resources */,
237-
944E83321D3987B3004A565E /* sc_img_touchid.png in Resources */,
235+
9471BF4B1E046F8E00DE5C51 /* sc_img_delete@2x.png in Resources */,
236+
9471BF4F1E046F8E00DE5C51 /* [email protected] in Resources */,
237+
9471BF4C1E046F8E00DE5C51 /* sc_img_delete@3x.png in Resources */,
238238
942AA3901D396DE8008E39F9 /* Main.storyboard in Resources */,
239239
);
240240
runOnlyForDeploymentPostprocessing = 0;

SCPinViewController/SCPinViewController/SCPinViewController.m

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ + (void)setNewAppearance:(SCPinAppearance *)newAppearance {
4949
#pragma mark - initialization
5050

5151
- (instancetype)initWithScope:(SCPinViewControllerScope)scope {
52-
self = [super initWithNibName:NSStringFromClass([SCPinViewController class]) bundle:nil];
52+
NSBundle *budle = [NSBundle bundleForClass:[SCPinViewController class]];
53+
NSLog(@"%@", budle);
54+
self = [super initWithNibName:NSStringFromClass([SCPinViewController class]) bundle:budle];
5355
if (self) {
5456
_scope = scope;
5557
if (!appearance) {
@@ -92,6 +94,10 @@ -(void)setupInitialState {
9294
[self.touchIDButton setHidden:NO];
9395
}
9496
}
97+
98+
if (!self.touchIDButton.isHidden) {
99+
self.touchIDButton.hidden = !appearance.touchIDButtonEnabled;
100+
}
95101
if ([self.dataSource respondsToSelector:@selector(showTouchIDVerificationImmediately)]) {
96102
BOOL immediately = [self.dataSource showTouchIDVerificationImmediately];
97103
if (immediately) {
@@ -116,6 +122,14 @@ -(void)configureView {
116122
[button setNeedsDisplay];
117123
}
118124

125+
NSBundle *bundle = [NSBundle bundleForClass:[SCPinViewController class]];
126+
127+
UIImage *deleteButtonImage = [UIImage imageNamed:@"sc_img_delete" inBundle:bundle compatibleWithTraitCollection:nil];
128+
[self.deleteButton setImage:deleteButtonImage forState:UIControlStateNormal];
129+
130+
UIImage *touchIDButtonImage = [UIImage imageNamed:@"sc_img_touchid" inBundle:bundle compatibleWithTraitCollection:nil];
131+
[self.touchIDButton setImage:touchIDButtonImage forState:UIControlStateNormal];
132+
119133
[self.deleteButton setTintColor:_appearance.deleteButtonColor];
120134
[self.touchIDButton setTintColor:_appearance.touchIDButtonColor];
121135

@@ -126,6 +140,8 @@ -(void)configureView {
126140
self.supportLabel.text = _appearance.supportText;
127141
self.supportLabel.font = _appearance.supportTextFont;
128142
self.supportLabel.textColor = _appearance.supportTextColor;
143+
144+
self.touchIDButton.hidden = !appearance.touchIDButtonEnabled;
129145

130146
}
131147

@@ -346,4 +362,4 @@ - (IBAction)deleteButtonAction:(UIButton *)sender {
346362

347363
}
348364

349-
@end
365+
@end

0 commit comments

Comments
 (0)