I'd like to create @IBInspectable
element as you see at the picture below :
my idea is to use something like enum as type for @IBInspectable
, but it looks like it's not the case, any ideas how to implement element like this ?
EDIT:
It looks like @IBInspectable
supports only these types :
Int
CGFloat
Double
String
Bool
CGPoint
CGSize
CGRect
UIColor
UIImage
bummer
That's not possible (for now). You can only use those types that you see in User Defined Runtime Attributes section.
From Apple's doc:
You can attach the IBInspectable attribute to any property in a class declaration, class extension, or category for any type that’s supported by the Interface Builder defined runtime attributes: boolean, integer or floating point number, string, localized string, rectangle, point, size, color, range, and nil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With