Skip to content

Commit

Permalink
moved strings files to bundle / use NSLocalizedStringFromTableInBundl…
Browse files Browse the repository at this point in the history
…e / adjusted podspec
  • Loading branch information
antiraum committed Nov 14, 2014
1 parent fd6aa02 commit 94a0ba5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 29 deletions.
8 changes: 4 additions & 4 deletions THPinViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "THPinViewController"
s.version = "1.2.3"
s.version = "1.2.4"
s.summary = "iOS 7 Style PIN Screen for iPhone and iPad"
s.description = <<-DESC
* Has iPhone portrait and iPad portrait and landscape layouts
Expand All @@ -13,9 +13,9 @@ Pod::Spec.new do |s|
s.license = 'MIT'
s.author = { "Thomas Heß" => "[email protected]" }
s.platform = :ios, '7.0'
s.source = { :git => "https://github.com/antiraum/THPinViewController.git", :tag => "1.2.3" }
s.source_files = 'THPinViewController'
s.resource_bundle = { 'Resources' => ['THPinViewController/Resources/*.lproj'] }
s.source = { :git => "https://github.com/antiraum/THPinViewController.git", :tag => "1.2.4" }
s.source_files = 'THPinViewController/*.{h,m}'
s.resources = 'THPinViewController/*.bundle'
s.requires_arc = true
s.screenshots = [ "https://raw.githubusercontent.com/antiraum/THPinViewController/master/THPinViewController_iphone_4inch.png",
"https://raw.githubusercontent.com/antiraum/THPinViewController/master/THPinViewController_iphone_3-5inch.png",
Expand Down
8 changes: 6 additions & 2 deletions THPinViewController/THPinView.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,19 @@ - (void)setDisableCancel:(BOOL)disableCancel

- (void)updateBottomButton
{
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"THPinViewController"
ofType:@"bundle"]];
if ([self.input length] == 0) {
self.bottomButton.hidden = self.disableCancel;
[self.bottomButton setTitle:NSLocalizedStringFromTable(@"cancel_button_title", @"THPinViewController", nil)
[self.bottomButton setTitle:NSLocalizedStringFromTableInBundle(@"cancel_button_title", @"THPinViewController",
bundle, nil)
forState:UIControlStateNormal];
[self.bottomButton removeTarget:self action:@selector(delete:) forControlEvents:UIControlEventTouchUpInside];
[self.bottomButton addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchUpInside];
} else {
self.bottomButton.hidden = NO;
[self.bottomButton setTitle:NSLocalizedStringFromTable(@"delete_button_title", @"THPinViewController", nil)
[self.bottomButton setTitle:NSLocalizedStringFromTableInBundle(@"delete_button_title", @"THPinViewController",
bundle, nil)
forState:UIControlStateNormal];
[self.bottomButton removeTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchUpInside];
[self.bottomButton addTarget:self action:@selector(delete:) forControlEvents:UIControlEventTouchUpInside];
Expand Down
4 changes: 3 additions & 1 deletion THPinViewController/THPinViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ - (instancetype)initWithDelegate:(id<THPinViewControllerDelegate>)delegate
_delegate = delegate;
_backgroundColor = [UIColor whiteColor];
_translucentBackground = NO;
_promptTitle = NSLocalizedStringFromTable(@"prompt_title", @"THPinViewController", nil);
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"THPinViewController"
ofType:@"bundle"]];
_promptTitle = NSLocalizedStringFromTableInBundle(@"prompt_title", @"THPinViewController", bundle, nil);
}
return self;
}
Expand Down
26 changes: 4 additions & 22 deletions THPinViewControllerExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
E2075FE01A160CCB0018078F /* THPinViewController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E2075FDF1A160CCB0018078F /* THPinViewController.bundle */; };
E222D1FD1902F00900DD1762 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E222D1FB1902F00900DD1762 /* Main.storyboard */; };
E25C5FBF192C993F0073E612 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = E25C5FBE192C993F0073E612 /* [email protected] */; };
E25C5FC5192CBF010073E612 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = E25C5FC4192CBF010073E612 /* UIImage+ImageEffects.m */; };
Expand All @@ -29,7 +30,6 @@
E2742FC419043598003EF85C /* THPinNumPadView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2742FC319043598003EF85C /* THPinNumPadView.m */; };
E2742FC719043A27003EF85C /* THPinInputCirclesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2742FC619043A27003EF85C /* THPinInputCirclesView.m */; };
E2742FCB19058BCA003EF85C /* THPinView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2742FCA19058BCA003EF85C /* THPinView.m */; };
E2DCAD801A0D27DA00F0710C /* THPinViewController.strings in Resources */ = {isa = PBXBuildFile; fileRef = E2DCAD7D1A0D27D900F0710C /* THPinViewController.strings */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -43,6 +43,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
E2075FDF1A160CCB0018078F /* THPinViewController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = THPinViewController.bundle; sourceTree = "<group>"; };
E222D1FC1902F00900DD1762 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Main.storyboard; sourceTree = "<group>"; };
E24B76CC195D674F00705E35 /* THPinViewControllerMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THPinViewControllerMacros.h; sourceTree = "<group>"; };
E25C5FBE192C993F0073E612 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -78,12 +79,6 @@
E2742FC619043A27003EF85C /* THPinInputCirclesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THPinInputCirclesView.m; sourceTree = "<group>"; };
E2742FC919058BCA003EF85C /* THPinView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THPinView.h; sourceTree = "<group>"; };
E2742FCA19058BCA003EF85C /* THPinView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THPinView.m; sourceTree = "<group>"; };
E2DCAD7E1A0D27D900F0710C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Resources/de.lproj/THPinViewController.strings; sourceTree = "<group>"; };
E2DCAD7F1A0D27D900F0710C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/THPinViewController.strings; sourceTree = "<group>"; };
E2DCAD811A0D27E300F0710C /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Resources/es.lproj/THPinViewController.strings; sourceTree = "<group>"; };
E2DCAD821A0D27E300F0710C /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Resources/fr.lproj/THPinViewController.strings; sourceTree = "<group>"; };
E2DCAD831A0D27EC00F0710C /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Resources/it.lproj/THPinViewController.strings; sourceTree = "<group>"; };
E2DCAD841A0D27EC00F0710C /* zh-Hans-CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans-CN"; path = "Resources/zh-Hans-CN.lproj/THPinViewController.strings"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -200,7 +195,7 @@
E2742FCA19058BCA003EF85C /* THPinView.m */,
E26048DB19027DBC006ACBC7 /* THPinViewController.h */,
E26048DC19027DBC006ACBC7 /* THPinViewController.m */,
E2DCAD7D1A0D27D900F0710C /* THPinViewController.strings */,
E2075FDF1A160CCB0018078F /* THPinViewController.bundle */,
E24B76CC195D674F00705E35 /* THPinViewControllerMacros.h */,
E25C5FC3192CBF010073E612 /* UIImage+ImageEffects.h */,
E25C5FC4192CBF010073E612 /* UIImage+ImageEffects.m */,
Expand Down Expand Up @@ -291,7 +286,7 @@
files = (
E222D1FD1902F00900DD1762 /* Main.storyboard in Resources */,
E25C5FBF192C993F0073E612 /* [email protected] in Resources */,
E2DCAD801A0D27DA00F0710C /* THPinViewController.strings in Resources */,
E2075FE01A160CCB0018078F /* THPinViewController.bundle in Resources */,
E26048BA19027D01006ACBC7 /* Images.xcassets in Resources */,
E26048AC19027D01006ACBC7 /* InfoPlist.strings in Resources */,
);
Expand Down Expand Up @@ -368,19 +363,6 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
E2DCAD7D1A0D27D900F0710C /* THPinViewController.strings */ = {
isa = PBXVariantGroup;
children = (
E2DCAD7E1A0D27D900F0710C /* de */,
E2DCAD7F1A0D27D900F0710C /* en */,
E2DCAD811A0D27E300F0710C /* es */,
E2DCAD821A0D27E300F0710C /* fr */,
E2DCAD831A0D27EC00F0710C /* it */,
E2DCAD841A0D27EC00F0710C /* zh-Hans-CN */,
);
name = THPinViewController.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down

0 comments on commit 94a0ba5

Please sign in to comment.