Post

Replies

Boosts

Views

Activity

Reply to Providing XCAssets Folder in Swift Package Xcode 12
Using the workaround suggested by Skyler_S and Nekitosss works! The only scenario in which it doesn't is when you are using the bundle in UI Tests. I've found that it's sufficient to add: swift Bundle(for: CurrentBundleFinder.self).resourceURL?.deletingLastPathComponent() to the list of candidates: swift let candidates = [ /* Bundle should be present here when the package is linked into an App. */ Bundle.main.resourceURL, /* Bundle should be present here when the package is linked into a framework. */ Bundle(for: CurrentBundleFinder.self).resourceURL, /* Bundle should be present here when the package is used in UI Tests. */ Bundle(for: CurrentBundleFinder.self).resourceURL?.deletingLastPathComponent(), /* For command-line tools. */ Bundle.main.bundleURL, /* Bundle should be present here when running previews from a different package (this is the path to "…/Debug-iphonesimulator/"). */ Bundle(for: CurrentBundleFinder.self).resourceURL?.deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent(), Bundle(for: CurrentBundleFinder.self).resourceURL?.deletingLastPathComponent().deletingLastPathComponent() ]
May ’21