Skip to content

Commit b19a4cb

Browse files
committedDec 9, 2023
fix and simplify bundle resource path hyperoslo#481
1 parent d8a8f84 commit b19a4cb

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed
 

‎.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// swift-tools-version:5.1
1+
// swift-tools-version:5.8
22

33
import PackageDescription
44

55
let package = Package(
66
name: "ImagePicker",
77
platforms: [
8-
.iOS(.v9)
8+
.iOS(.v10)
99
],
1010
products: [
1111
// Products define the executables and libraries produced by a package, and make them visible to other packages.

‎Source/AssetManager.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ import Photos
44

55
extension Bundle {
66
static func myResourceBundle() -> Bundle? {
7-
let bundles = Bundle.allBundles
8-
let bundlePaths = bundles.compactMap { $0.resourceURL?.appendingPathComponent("ImagePicker", isDirectory: false).appendingPathExtension("bundle") }
9-
10-
return bundlePaths.compactMap({ Bundle(url: $0) }).first
7+
return Bundle(for: ImagePickerController.self)
118
}
129
}
13-
1410
open class AssetManager {
1511

1612
public static func getImage(_ name: String) -> UIImage {

0 commit comments

Comments
 (0)
Please sign in to comment.