Skip to content

Commit

Permalink
fix and simplify bundle resource path hyperoslo#481
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelar committed Dec 9, 2023
1 parent d8a8f84 commit b19a4cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// swift-tools-version:5.1
// swift-tools-version:5.8

import PackageDescription

let package = Package(
name: "ImagePicker",
platforms: [
.iOS(.v9)
.iOS(.v10)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
Expand Down
6 changes: 1 addition & 5 deletions Source/AssetManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import Photos

extension Bundle {
static func myResourceBundle() -> Bundle? {
let bundles = Bundle.allBundles
let bundlePaths = bundles.compactMap { $0.resourceURL?.appendingPathComponent("ImagePicker", isDirectory: false).appendingPathExtension("bundle") }

return bundlePaths.compactMap({ Bundle(url: $0) }).first
return Bundle(for: ImagePickerController.self)
}
}

open class AssetManager {

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

0 comments on commit b19a4cb

Please sign in to comment.