diff --git a/THPinViewController.podspec b/THPinViewController.podspec index 26702bc..2d58ab5 100644 --- a/THPinViewController.podspec +++ b/THPinViewController.podspec @@ -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 @@ -13,9 +13,9 @@ Pod::Spec.new do |s| s.license = 'MIT' s.author = { "Thomas Heß" => "mail@thomashess.name" } 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", diff --git a/THPinViewController/THPinView.m b/THPinViewController/THPinView.m index cea475c..a29c69e 100644 --- a/THPinViewController/THPinView.m +++ b/THPinViewController/THPinView.m @@ -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]; diff --git a/THPinViewController/Resources/de.lproj/THPinViewController.strings b/THPinViewController/THPinViewController.bundle/de.lproj/THPinViewController.strings similarity index 100% rename from THPinViewController/Resources/de.lproj/THPinViewController.strings rename to THPinViewController/THPinViewController.bundle/de.lproj/THPinViewController.strings diff --git a/THPinViewController/Resources/en.lproj/THPinViewController.strings b/THPinViewController/THPinViewController.bundle/en.lproj/THPinViewController.strings similarity index 100% rename from THPinViewController/Resources/en.lproj/THPinViewController.strings rename to THPinViewController/THPinViewController.bundle/en.lproj/THPinViewController.strings diff --git a/THPinViewController/Resources/es.lproj/THPinViewController.strings b/THPinViewController/THPinViewController.bundle/es.lproj/THPinViewController.strings similarity index 100% rename from THPinViewController/Resources/es.lproj/THPinViewController.strings rename to THPinViewController/THPinViewController.bundle/es.lproj/THPinViewController.strings diff --git a/THPinViewController/Resources/fr.lproj/THPinViewController.strings b/THPinViewController/THPinViewController.bundle/fr.lproj/THPinViewController.strings similarity index 100% rename from THPinViewController/Resources/fr.lproj/THPinViewController.strings rename to THPinViewController/THPinViewController.bundle/fr.lproj/THPinViewController.strings diff --git a/THPinViewController/Resources/it.lproj/THPinViewController.strings b/THPinViewController/THPinViewController.bundle/it.lproj/THPinViewController.strings similarity index 100% rename from THPinViewController/Resources/it.lproj/THPinViewController.strings rename to THPinViewController/THPinViewController.bundle/it.lproj/THPinViewController.strings diff --git a/THPinViewController/Resources/zh-Hans-CN.lproj/THPinViewController.strings b/THPinViewController/THPinViewController.bundle/zh-Hans-CN.lproj/THPinViewController.strings similarity index 100% rename from THPinViewController/Resources/zh-Hans-CN.lproj/THPinViewController.strings rename to THPinViewController/THPinViewController.bundle/zh-Hans-CN.lproj/THPinViewController.strings diff --git a/THPinViewController/THPinViewController.m b/THPinViewController/THPinViewController.m index 31fbe45..6005568 100644 --- a/THPinViewController/THPinViewController.m +++ b/THPinViewController/THPinViewController.m @@ -27,7 +27,9 @@ - (instancetype)initWithDelegate:(id)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; } diff --git a/THPinViewControllerExample.xcodeproj/project.pbxproj b/THPinViewControllerExample.xcodeproj/project.pbxproj index 1a11210..4f8ef91 100644 --- a/THPinViewControllerExample.xcodeproj/project.pbxproj +++ b/THPinViewControllerExample.xcodeproj/project.pbxproj @@ -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 /* confidential@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E25C5FBE192C993F0073E612 /* confidential@2x.png */; }; E25C5FC5192CBF010073E612 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = E25C5FC4192CBF010073E612 /* UIImage+ImageEffects.m */; }; @@ -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 */ @@ -43,6 +43,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + E2075FDF1A160CCB0018078F /* THPinViewController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = THPinViewController.bundle; sourceTree = ""; }; E222D1FC1902F00900DD1762 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Main.storyboard; sourceTree = ""; }; E24B76CC195D674F00705E35 /* THPinViewControllerMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THPinViewControllerMacros.h; sourceTree = ""; }; E25C5FBE192C993F0073E612 /* confidential@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "confidential@2x.png"; sourceTree = ""; }; @@ -78,12 +79,6 @@ E2742FC619043A27003EF85C /* THPinInputCirclesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THPinInputCirclesView.m; sourceTree = ""; }; E2742FC919058BCA003EF85C /* THPinView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THPinView.h; sourceTree = ""; }; E2742FCA19058BCA003EF85C /* THPinView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THPinView.m; sourceTree = ""; }; - E2DCAD7E1A0D27D900F0710C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Resources/de.lproj/THPinViewController.strings; sourceTree = ""; }; - E2DCAD7F1A0D27D900F0710C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/THPinViewController.strings; sourceTree = ""; }; - E2DCAD811A0D27E300F0710C /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Resources/es.lproj/THPinViewController.strings; sourceTree = ""; }; - E2DCAD821A0D27E300F0710C /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Resources/fr.lproj/THPinViewController.strings; sourceTree = ""; }; - E2DCAD831A0D27EC00F0710C /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Resources/it.lproj/THPinViewController.strings; sourceTree = ""; }; - E2DCAD841A0D27EC00F0710C /* zh-Hans-CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans-CN"; path = "Resources/zh-Hans-CN.lproj/THPinViewController.strings"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -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 */, @@ -291,7 +286,7 @@ files = ( E222D1FD1902F00900DD1762 /* Main.storyboard in Resources */, E25C5FBF192C993F0073E612 /* confidential@2x.png in Resources */, - E2DCAD801A0D27DA00F0710C /* THPinViewController.strings in Resources */, + E2075FE01A160CCB0018078F /* THPinViewController.bundle in Resources */, E26048BA19027D01006ACBC7 /* Images.xcassets in Resources */, E26048AC19027D01006ACBC7 /* InfoPlist.strings in Resources */, ); @@ -368,19 +363,6 @@ name = InfoPlist.strings; sourceTree = ""; }; - E2DCAD7D1A0D27D900F0710C /* THPinViewController.strings */ = { - isa = PBXVariantGroup; - children = ( - E2DCAD7E1A0D27D900F0710C /* de */, - E2DCAD7F1A0D27D900F0710C /* en */, - E2DCAD811A0D27E300F0710C /* es */, - E2DCAD821A0D27E300F0710C /* fr */, - E2DCAD831A0D27EC00F0710C /* it */, - E2DCAD841A0D27EC00F0710C /* zh-Hans-CN */, - ); - name = THPinViewController.strings; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */