Skip to content

Commit

Permalink
fixed a bug of getting resources
Browse files Browse the repository at this point in the history
  • Loading branch information
alisamaiee committed Sep 13, 2021
1 parent 051bf67 commit da3d90d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AdvancedActionSheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pod::Spec.new do |spec|
spec.summary = "A CocoaPods library written in Swift"

spec.description = <<-DESC
This CocoaPods library for iOS, offering you advanced alert actions sheet.
This CocoaPods library for iOS, offering you advanced alert action sheet.
DESC

spec.homepage = "https://github.com/alisamaiee/AdvancedActionSheet"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<key>AdvancedActionSheet.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
<key>AdvancedActionSheetExamples.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import UIKit

internal class ImageUtility {
static func getImage(named: String) -> UIImage? {
return UIImage(named: named, in: Bundle(for: ImageUtility.self), compatibleWith: nil)
let bundle = Bundle(for: Self.self)
guard let resourceBundleURL = bundle.url(forResource: "AdvancedActionSheet", withExtension: "bundle")
else { fatalError("AdvancedActionSheet.bundle not found!") }
guard let resourceBundle = Bundle(url: resourceBundleURL)
else { fatalError("Cannot access AdvancedActionSheet.bundle!") }
let image = UIImage(named: named, in: resourceBundle, compatibleWith: nil)
return image
}
}

0 comments on commit da3d90d

Please sign in to comment.