-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse connections from Interface Builder files. #212
Comments
I would like to see that as well. Not just for actions and outlets, but also for classes. Maybe even distinguishing between top level objects and views nested deeper in the hierarchy. If a class referenced by a top level object from a nib is otherwise unused the chances are good that we can remove the whole class and the nib. |
Classes referenced by nibs are already parsed out, this issue is only for the IB* declarations. Currently what Periphery does is find all classes referenced in a nib, and then blindly retains all of its IB* declarations. So if you've a view controller no longer referenced by a nib, Periphery should detect that it's unused, provided it's not also referenced by other code. |
I see. Currently I have this case: I have a UIView subclass that is placed inside a xib file, but not referenced by code at all. There are also no IBActions or IBOutlets. Periphery marks this class as unused. If periphery is parsing IB files anyways it should be easy to mark this class as used too. Or do you think this should be a separate issue? |
Yes that sounds like a bug. Can you show me the contents of the xib? Also, is the xib a member of the build targets passed to --targets? |
That was it, I forgot to add the resource bundle target. This also resolved my issues from #234. |
Is there a way to get the opposite behaviour? I'm working on a project where every I've tried |
Yeah index excluding is only hooked up for Swift files currently. Could you open a new issue for this, and I'll implement it when I get a chance. |
I have an SPM target with a |
This is need so that we can identify individual unused @ib* declarations.
The text was updated successfully, but these errors were encountered: