I'm currently working on Swift Package Manager project and I need to use images (myImage
) I put in my custom XCAssets (CoreUI.xcassets
). I have included my XCAssets in the SPM resources like this.
targets: [
.target(
name: "MyCoreUI",
dependencies: [],
resources: [Resource.process("Resources/CoreUI.xcassets")]),
.testTarget(
name: "MyCoreUITests",
dependencies: ["MyCoreUI"]),
]
I accessed my image like this:
UIImage(named: "dropdown_down", in: Bundle.module, compatibleWith: nil)
But my image still failed to load without any warning. Could anyone help me with this issue? Thank you in advance!