@IBInspectable with enum?

ios, iphone, objective-c, swift, xcode

Solution

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.

Problem

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

Original source

Related problems