R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

image return nil when using r.swift.imageName

Open poomwtd opened this issue 11 months ago • 1 comments

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:

  • My main project also use r.swift
  • when i use UIImage(named: imageName , in: bundle, compatibleWith: nil) image show up normally
  • when i use R.swift.imageName i also use command "po UIImage(imageName)" its also return nil)

Thanks for your help

poomwtd avatar Mar 11 '24 09:03 poomwtd

Can you provide a demo project?

zhuamaodeyu avatar Apr 18 '24 09:04 zhuamaodeyu

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.

mac-cain13 avatar Sep 19 '24 08:09 mac-cain13