While developing an iOS application for targets below iOS 11, I accidentally left a named color in one of my storyboards. However, the error I got only shows the name of the storyboard and not the exact view that is causing the issue:
Named colors do not work prior to iOS 11.0
Main.storyboard
How can I find the exact views that have a named color as a property and replace those with a non-named color?
If you want to get the exact floating point values of your named colours, and then do a find / replace so that you can do a quick "replace all" instead of editing each individual colour. Just search for "namedColor" in your storyboard and you will find the colorus as they would appear normally eg.
<namedColor name="Grey Background">
<color red="0.92941176470588238" green="0.93333333333333335" blue="0.94117647058823528" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
Then do a Find/Replace with the search term:
name="Grey Background"/>
And copy-paste the following into the "With" section of the Find / Replace:
red="0.92941176470588238" green="0.93333333333333335" blue="0.94117647058823528" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Then hit "replace all". Don't forget to include the "/>" at the end of both the search term and the replacement text as this will ensure the name is not replaced in the "namedColor" section at the bottom of the storyboard document.
This should then replace all colours in your storyboard that match the exact name. Now just right-click the storyboard and open in interface builder again and the file will recompile and all colours should still look the same.
Things to note: