I'm building a modular iOS app with SwiftUI views in a framework target (MyFrameworkTarget). I added a new .xcassets catalog to this target and defined some named colors like "durationBackground". The assets work at runtime, but in SwiftUI previews, the colors fail to load (they render as clear/black).
I tried the following-
Ensured .xcassets is included in the correct framework target (Target Membership and Copy Bundle Resources).
Accessed the colors using:
Color("durationBackground", bundle: Bundle(for: SomeClass.self))
Color("durationBackground", bundle: Bundle(identifier: "com.mycompany.MyFrameworkTarget"))
What is the correct way to load colors from an .xcassets catalog inside a SwiftUI framework target, so that SwiftUI previews can render them correctly?
