@IBInspectable enums

It would be nice to be able to make swift enum variables @IBInspectable.


In the case of enums without associated values, I would imagine that it would just make a popup menu with a list of the enum names (and default). Enums with associated values could either continue to not be supported, or ideally have controls appear underneath the popup for the associated values.


Is there a good workaround at the moment?


I tried making separate @IBInspectable computable properties based on the enum, but the UI doesn't update for other properties, so it looks like things are in an inconsistent state (even if they aren't in the underlying view).

Replies

A popup menu is what you get in the Unity Edtior; it works great. But, being C#-based, they don't have to worry about associated values.

this was answered on SO.


Short answer: no.

Slightly longer answer: use an Adapter.

Can you elaborate on "use an Adapter"?