IBInspectable not working in storyboard

I am using the swift extension.


     extension UIView

     {

          @IBInspectable var cornerRadius: CGFloat {

               get { return layer.cornerRadius }

               set { layer.cornerRadius = newValue layer.masksToBounds = newValue > 0 }

          }

     }


Which is cookie cutter from several examples regarding @IBInspectable. However, when I use this in my project, the storyboard does not update while viewing in xcode, as in the link below


http://i.stack.imgur.com/r70IK.png


When compiling and running however, it does show the rounded corners. This is using xcode 6.3.2

If anyone has any suggestions, it would be very very much appreciated.


The project is here. github.com/captainchung/test

Typically you'd add these to a subclass with @IB_Designable before the class declaration. Then add the IB_Inspectable annotations where needed. Finally in the storyboard on one or more controls change to the subclass in the identity inspector. I think that will work. Also keep in mind that the rules are in flux. Many things work differently in the Xcode 7 beta (Swift 2.0).

I remember reading that you need to put these kind of classes/extensions into a custom framework in order for this to work. That's because the @IB_Designable views/extensions need to be loaded up within Interface Builder in order to actually show up in the canvas.

IBInspectable not working in storyboard
 
 
Q