Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Fix a resource bundle resolving issue introduced in #61. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
GetToSet authored Mar 19, 2022
1 parent 8c5dd19 commit 56bafee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion Framework/MASPreferencesWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,17 @@ + (NSBundle *)resourceBundle {
return SWIFTPM_MODULE_BUNDLE;
#else
NSBundle *moduleBundle = [NSBundle bundleForClass:MASPreferencesWindowController.class];
return [NSBundle bundleWithURL:[NSURL fileURLWithPath:[moduleBundle pathForResource:@"MASPreferences" ofType:@"bundle"]]];

// Lookup for MASPreferences.bundle, which usually comes with CocoaPods's `:linkage => :static`.
NSString *resourceBundlePath = [moduleBundle pathForResource:@"MASPreferences" ofType:@"bundle"];
if ([resourceBundlePath length]) {
NSBundle *resourceBundle = [NSBundle bundleWithURL:[NSURL fileURLWithPath:resourceBundlePath]];
if (resourceBundle) {
return resourceBundle;
}
}

return moduleBundle;
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions MASPreferences.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.platform = :osx, '10.10'
s.name = "MASPreferences"
s.version = "1.4"
s.version = "1.4.1"
s.summary = "Modern implementation of the Preferences window for OS X apps, used in TextMate, GitBox and Mou."
s.homepage = "https://github.com/shpakovski/MASPreferences"
s.license = { :type => 'BSD', :file => 'LICENSE.md' }
s.author = { "Vadim Shpakovski" => "[email protected]" }
s.source = { :git => 'https://github.com/shpakovski/MASPreferences.git', :tag => '1.4' }
s.source = { :git => 'https://github.com/shpakovski/MASPreferences.git', :tag => '1.4.1' }
s.source_files = 'Framework/*.{h,m}'
s.resource_bundles = {
'MASPreferences' => ['Framework/en.lproj/*.xib']
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ You can find a Demo project at [MASPreferencesDemo](https://github.com/shpakovsk

#### [Swift Package Manager](https://www.swift.org/package-manager/)

- Add `.package(url: "https://github.com/shpakovski/MASPreferences.git", .upToNextMajor(from: "1.4"))` to your Package.swift.
- Add `.package(url: "https://github.com/shpakovski/MASPreferences.git", .upToNextMajor(from: "1.4.1"))` to your Package.swift.

0 comments on commit 56bafee

Please sign in to comment.