有时 Xcode 无法确定moduleBundle 中的参数。
类型“捆绑”没有成员“模块”
我的调查表明,SPM 会在名为的文件中自动为该属性生成模块扩展(有时)resource_bundle_accessor:
import class Foundation.Bundle
private class BundleFinder {}
extension Foundation.Bundle {
/// Returns the resource bundle associated with the current Swift module.
static var module: Bundle = {
let bundleName = "ABUIKit_ABStyleKit"
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: BundleFinder.self).resourceURL,
// For command-line …Run Code Online (Sandbox Code Playgroud)