fernandodelrio/SwiftColorGen

Remove "namedColor" duplicates that Xcode generates sometimes

Closed this issue · 1 comments

Sometimes when assigning a Named Color inside the storyboard, Xcode adds a duplicated entry for the same namedColor in the storyboard's xml. This can be easily seen, even without using this tool, just start assigning the same Named Color to different places, and you should see the duplicated entry in the xml.

If you re-open the interface builder, Xcode should display a warning about that and then it will remove the duplicated entry. I found an open radar for that: https://openradar.appspot.com/35172913

If we run SwiftColorGen, it will not remove the duplicated entry and when the Interface Builder reloads, the user will have the false impression, the tool introduced an error.

Considering that, a enhancement can be made:

Everytime SwiftGen runs, it should ensure there's no duplicates in the namedColor keys in the storyboard xml's.

Moving issue to the SwiftColorGenLibrary repo