title: UIButton with IB_DESIGNABLE throws runtime attribute warning and does not render in Interface Builder
body: <p>I'm running Xcode 6.1 and I have been using IB_DESIGNABLE with IBInspectable for quite a few projects already but all of the sudden it just doesn't work anymore. I have created subclassed buttons that arrange the image and the title vertically centred above each other and enable the user to set a border width and color through IB with IBInspectable.</p>
  
  <p>The following warning is logged and there is no preview available of my code in drawRect:</p>
  
  <pre><code>warning: IB Designables: Ignoring user defined runtime attribute for key path "spacingBetweenLabelAndImage" on instance of "UIButton". Hit an exception when attempting to set its value: [&lt;UIButton 0x7f9278591260&gt; setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key spacingBetweenLabelAndImage.
  </code></pre>
  
  <p>Still, runtime it renders like I intended it to render and it also honours that same custom spacing I've added through IB.</p>
  
  <p>Here's the code of the menubutton that rearranges the button and the title:</p>
  
  <pre><code>#import "HamburgerButton.h"
  
  IB_DESIGNABLE
  @interface HamburgerImageButton : HamburgerButton
  
  @property IBInspectable CGFloat spacingBetweenLabelAndImage;
  
  @end
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>#import "HamburgerImageButton.h"
  
  @implementation HamburgerImageButton
  
  - (void)drawRect:(CGRect)rect {
      [super drawRect:rect];
  
      CGSize imageSize = self.imageView.frame.size;
      CGSize titleSize = self.titleLabel.frame.size;
  
      // Move the label left and the image right by half the width
      CGFloat leftInset = titleSize.width / 2;
      CGFloat rightInset = imageSize.width / 2;
  
      CGFloat halfSpacing = self.spacingBetweenLabelAndImage == 0 ? 0 : self.spacingBetweenLabelAndImage / 2;
  
      CGFloat topInset = imageSize.height / 2 + halfSpacing;
      CGFloat bottomInset = titleSize.height / 2 + halfSpacing;
  
      UIEdgeInsets imageInsets = UIEdgeInsetsMake(-bottomInset, leftInset, bottomInset, -leftInset);
      UIEdgeInsets titleInsets = UIEdgeInsetsMake(topInset, -rightInset, -topInset, rightInset);
      self.imageEdgeInsets = imageInsets;
      self.titleEdgeInsets = titleInsets;
  }
  
  @end
  </code></pre>
  
  <p>You've probably noticed it inherits HamburgerButton. This basic hamburger button does not have an image and it only draws the border around the button. This basic hamburger button has exactly the same problem: it does not draw it's border in drawRect in IB and it has the same type of errors. Here's that code for sake of completeness:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  IB_DESIGNABLE
  @interface HamburgerButton : UIButton
  
  @property IBInspectable CGFloat borderWidth;
  @property IBInspectable UIColor *borderColor;
  
  @end
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>#import "HamburgerButton.h"
  #import &lt;QuartzCore/QuartzCore.h&gt;
  
  @implementation HamburgerButton
  
  - (void)copyInspectables {
      self.layer.borderWidth = self.borderWidth;
      self.layer.borderColor = self.borderColor.CGColor;
  }
  
  - (void)drawRect:(CGRect)rect {
      [self copyInspectables];
  }
  
  @end
  </code></pre>
  
  <p>I don't really understand why it just throws a warning and nothing else. I didn't really change what I did. I've checked the storyboard, it's iOS 7 and up, meant to run in Xcode 6 (latest).</p>
  
  <p>It complains about not being able to find that value on UIButton and that's a bit weird because I've subclassed it.</p>
  
  <hr>
  
  <p>Update: 
  So I changed everything around and it worked. Now it craps out again, without changing anything else. I think there's a bug in Xcode 6.1... :/</p>