-
Notifications
You must be signed in to change notification settings - Fork 757
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
Warn about duplicate identifiers #34
Comments
For images this will be fixed with PR #44 |
I think duplicate reusable cells warning may be valuable - as there is no real requirement for cells to be unique across project. I have couple of default "Cell" identifiers which result in uncompilable code. I fixed it on private branch by de-duplication of reusable cells variables, which should(?) do no harm. |
@tomekc Thanks for replying! Yes, true, it's valid and can be used. I would consider it a bad practice, it's better to explicitly and uniquely name your cells to make them easily reusable and prevent confusion. My opinion is that R.swift should warn you about it and just skip those cells in the struct. Of course it should never generate uncompilable code. |
Segues should be changed so they are an extension on the viewcontroller and not global things. This makes duplicates less likely and if in that situation there are duplicates they really are a problem so a warning is appropriate then. This also would enable us to make typed segues in the end. |
Duplicate viewController identifiers give compile errors from Apple's storyboard compiler. So this is a lower priority thing. Won't fix it now, maybe sometime in the future. It's not a problem that R.swift generated uncompilable code from such a storyboard since the storyboard itself also won't compile. |
True, but it is a good practice to have multiple storyboards in larger projects. R.swift bundles all identifiers from all storyboards. You do not really have to use globally unique cell or segue identifiers across all storyboards, do you? |
Issue #71 proposes to scope segues to their source ViewController, so that would fix that problem. Cells in different storyboards don't really have to be unique that's correct, outside storyboards (in nib files) it is good practice to have unique identifiers. I think it's not very user friendly/handy to namespace the reuseIdentifiers. What would be your ideal solution? |
I think if the reuseIdentifiers are in different storyboards you shouldn't flag a warning. That would be ideal. I use the slightly juvenile reuseIdentifier |
I think the |
The text was updated successfully, but these errors were encountered: