mac-cain13 / R.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
MIT License
9.5k stars 764 forks source link

image return nil when using r.swift.imageName #888

Closed poomwtd closed 1 month ago

poomwtd commented 8 months ago

Hi everyone, i'm currently build a framework for ios using r.swift (using r.swift in framework) but when i plug a framework into my main app an image will disappeared (r.swift.imageName return nil) but image that set using storyboard is showing normally so how could i fix my issue FYI:

Thanks for your help

zhuamaodeyu commented 7 months ago

Can you provide a demo project?

mac-cain13 commented 1 month ago

R.swift in the end does call UIImage(named: imageName , in: bundle, compatibleWith: nil) to get the image, where the bundle is the bundle where the R.generated.swift is embedded into.

Are you sure you are calling the R.swift.imageName from the framework and not the one that might be in the app or something like that?

Closing this since it's a bit dated already, but feel free to comment, we can reopen if this is still relevant.