Hi everyone,
i want to use R.swift in my Objecitve-C Project and used !use_frameworks in the pod file. But after importing the R.generated.swift file i cant compile anymore because in the swift file he cant find all the classed because they are not imported in the bridge header, but i dont want to add manually 100 classes to the bridge file.
Do u have any suggestions for this kind of issue?
Thanks :)
I'm not familiar with anybody using R.swift in combination with Objective-C.
It's not a scenario that we've considered or tested when building R.swift.
However, if there's someone that actually managed to get this to work, I'd be interested in hearing about it!
Hi, I can point out as a side note, that it does indeed work (very well in fact),if (and only if) you add all the headers. (I have tried it on a large project, and that was almost a 100 headers to import).
The best solution is to either copy the errors from xcode into the bridgeheader and then (propperly macro it), to change the lines into import statements.
I think the consequence of using a mixed project is that you have to import ObjC class referenced in a Swift file. We could generate code into the bridging header, but I feel that use case is not big enough to put so much time into.
For now I would suggest to copy the errors and macro/script/use a smart editor to quickly convert them to imports for in the bridging header. Once somebody has written a small script to do it that would be an easy way of getting those imports in a the bridging header.
If anyone is still interested on using R.swift in ObjC project, I announce you we (tried to) implement an ObjC alternative, freely inspired (Thank you a lot) to R.swift: https://github.com/SysdataSpA/R.objc
Awesome @sysdataitalia! Very nice of you to share this with us, it's great to be an inspiration and nice to see you're taking care of all of us that use ObjC for their projects! Great!
@mac-cain13 didn't want to make a new issue, but I'm curious what the chances are that you would merge Objective-C support for R.swift if I were to write it up. Right now in a branch of mine I am just tacking this on to the end of R.generated.swift. It's opt-in only, (pass --objc on the CLI).

The reason for this support is making it easier to identify unused resources in our project. R.swift's validate goes a long way to validating images contained in xibs and storyboards (which I am very thankful for!) however we still have 277 instances of [UIImage imageNamed:@"…"] in our codebase (large project, as you could probably tell by the line numbers in that screenshot). It's way too much code to migrate, but exposing R.swift's functionality to Objective-C would be a huge win for us (and maybe others).
Things I'd promise on the eventual PR:
extensions that implement ObjcConvertibleCode on Struct, Function, etc.However, I also understand the name of this project is R.swift, so if you don't want support added that's fine by me as well. I'll still write it all up in a fork, but to be honest it'll probably be worse quality and not tested as well if I know it won't hit upstream :)
Most helpful comment
If anyone is still interested on using R.swift in ObjC project, I announce you we (tried to) implement an ObjC alternative, freely inspired (Thank you a lot) to R.swift: https://github.com/SysdataSpA/R.objc