From bc0913522449bfa41594beaedcd59106974de076 Mon Sep 17 00:00:00 2001 From: Eli Lien Date: Fri, 5 Feb 2016 12:18:41 +0800 Subject: [PATCH 1/2] Change the way it get its bundle. --- .../PKAlertController.xcodeproj/project.pbxproj | 16 ++++++++++++++++ Example/Podfile | 16 ++++++++-------- Pod/Classes/PKAlertUtility.m | 6 ++++-- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Example/PKAlertController.xcodeproj/project.pbxproj b/Example/PKAlertController.xcodeproj/project.pbxproj index d82b9b3..0413353 100644 --- a/Example/PKAlertController.xcodeproj/project.pbxproj +++ b/Example/PKAlertController.xcodeproj/project.pbxproj @@ -226,6 +226,7 @@ 6003F587195388D20070C39A /* Frameworks */, 6003F588195388D20070C39A /* Resources */, 936C7B2139F3609A09F57627 /* Copy Pods Resources */, + E4017E52BA51BBAFDB2B29C2 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -376,6 +377,21 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PKAlertController/Pods-PKAlertController-resources.sh\"\n"; showEnvVarsInLog = 0; }; + E4017E52BA51BBAFDB2B29C2 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PKAlertController/Pods-PKAlertController-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/Example/Podfile b/Example/Podfile index 945cec4..57ed2f2 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -7,11 +7,11 @@ target 'PKAlertController', :exclusive => true do pod 'FLEX', '~> 2.0.0' end -target 'Tests', :exclusive => true do - pod "PKAlertController", :path => "../" - - pod 'Specta' - pod 'Expecta' - pod 'FBSnapshotTestCase', '~> 1.6.0' - pod 'Expecta+Snapshots' -end +#target 'Tests', :exclusive => true do +# pod "PKAlertController", :path => "../" +# +# pod 'Specta' +# pod 'Expecta' +# pod 'FBSnapshotTestCase', '~> 1.6.0' +# pod 'Expecta+Snapshots' +#end diff --git a/Pod/Classes/PKAlertUtility.m b/Pod/Classes/PKAlertUtility.m index b5cfd96..8c156f4 100644 --- a/Pod/Classes/PKAlertUtility.m +++ b/Pod/Classes/PKAlertUtility.m @@ -7,6 +7,7 @@ // #import "PKAlertUtility.h" +#import "PKAlertViewController.h" const CGFloat PKAlertDefaultMargin = 8.0; const CGFloat PKAlertDefaultTappableHeight = 44.0; @@ -34,8 +35,9 @@ NSBundle *PKAlertControllerBundle(void) { - NSString *path = [[NSBundle mainBundle] pathForResource:@"PKAlertController" ofType:@"bundle"]; - return [NSBundle bundleWithPath:path]; + NSBundle *frameworkBundle = [NSBundle bundleForClass:[PKAlertViewController class]]; + NSString *bundlePath = [[frameworkBundle resourcePath] stringByAppendingPathComponent:@"PKAlertController.bundle"]; + return [NSBundle bundleWithPath:bundlePath]; } void PKAlertReloadAppearance() From 29cf7a1f2980b205162fa7e95c554f21b95cb2fb Mon Sep 17 00:00:00 2001 From: Eli Lien Date: Mon, 8 Feb 2016 16:50:01 +0800 Subject: [PATCH 2/2] Change PKAlertViewController to PKAlertUtility. --- Pod/Classes/PKAlertUtility.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Pod/Classes/PKAlertUtility.m b/Pod/Classes/PKAlertUtility.m index 8c156f4..baf5ccf 100644 --- a/Pod/Classes/PKAlertUtility.m +++ b/Pod/Classes/PKAlertUtility.m @@ -7,7 +7,6 @@ // #import "PKAlertUtility.h" -#import "PKAlertViewController.h" const CGFloat PKAlertDefaultMargin = 8.0; const CGFloat PKAlertDefaultTappableHeight = 44.0; @@ -35,7 +34,7 @@ NSBundle *PKAlertControllerBundle(void) { - NSBundle *frameworkBundle = [NSBundle bundleForClass:[PKAlertViewController class]]; + NSBundle *frameworkBundle = [NSBundle bundleForClass:[PKAlertUtility class]]; NSString *bundlePath = [[frameworkBundle resourcePath] stringByAppendingPathComponent:@"PKAlertController.bundle"]; return [NSBundle bundleWithPath:bundlePath]; }