I am creating a private library that includes resources that are referenced by components in the library. The library is shared with apps using CocoaPods. In the .podspec for
For example Paramount
podspec
s.resource_bundle = {
'Paramount' => ['Sources/Paramount.bundle/*.png']
}
swift
public extension UIImage {
static func make(name: String) -> UIImage? {
let bundle = NSBundle(forClass: Paramount.Toolbar.self)
return UIImage(named: "Paramount.bundle/\(name)", inBundle: bundle, compatibleWithTraitCollection: nil)
}
}
Here Paramount.Toolbar.self
can be any class in that framework