mac-cain13 / R.swift

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

R.swift doesn't generate resources for xibs and storyboards in SPM #907

Closed Olexantor closed 2 weeks ago

Olexantor commented 2 weeks ago

I need to transfer all resources to SPM. Strings and assets of images are fine, but xibs and storyboards are a problem. At the same time, information about them appears in the R.generated file in the form of messages: "// This _R.nib struct is generated, and contains static references to 50 nibs." "/// This _R.storyboard struct is generated, and contains static references to 17 storyboards." But opposite the lines generated for xibs and storyboards there is an error like "Cannot find type 'SomeView' in scope", "Cannot find type 'SomeViewController' in scope" and accordingly, due to these errors, R.nib, R.Storyboard and R.reuseidentifier are not available. Please advise what can be done in such a situation.

Olexantor commented 2 weeks ago

I apologize, I figured out the problem myself. It is likely that the library works with storyboard with swift-file or xib with swift-file file pairs. If you transfer them in pairs to SPM, then resources are generated.