Named Colors Properties Catalog Not Available for @IBInspectable properties

For my iPad application that I am creating, I have an asset catalog in my project containing several sets of colors. I know that I can drag them into the code itself and did this for the default color of the @IBInspectable class @IBInspectable . However, when I use them in Interface Builder, my color sets are available for properties, such as the background color of the UIView, but they are not available for any @IBInspectable property that allows users to set the color. Is there a way to put my color sets in my @IBInspectable class where they can be selected in Interface Builder? Of course, I can always install them programmatically, but for future use and convenience I would like this work to work if Apple currently supports it. The My Colors Asset directory has definitely been added to my Bundle Resources project in my build settings if this information is relevant.

Screenshots of my problem:

This first image shows where my color sets are selected for properties like the UIView background. The following two show that they are not available for my @IBInspectable properties.

Color sets selectable for UIView Background

Color set appears as missing to @IBInspectable property

Color sets not selectable for @IBInspectable property

+5
source share
1 answer

I found a workaround until Xcode fixes this problem. enter image description here

Use recently used colors, and if you choose the one that is in your assets (in the latest onces), it will automatically change it to a specific one. It works for me :) enter image description here

+1
source

Source: https://habr.com/ru/post/1273109/


All Articles