title: Set UIButton Layer Border Width and Color in Interface Builder
body: <p>Can I use IB_DESIGNABLE and/or IBInspectable to set layer.borderWidth and layer.borderColor in Interface Builder? I am currently creating my button in code but I'd like to be able to set all of this in IB but I'm not sure if these properties can be set that way in Xcode 6. I'd like to make this an IBOutlet instead of having all of this set in code. Here is my button code now.</p>
  
  <pre><code>directions = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  directions.titleLabel.textAlignment = NSTextAlignmentCenter;
  directions.titleLabel.font = [UIFont fontWithName:@"FranklinGothicStd-ExtraCond" size:20.0];
  [directions setTitle:@"Directions" forState:UIControlStateNormal];
  [directions setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  directions.frame = CGRectMake(20, 178, 70, 70);
  directions.layer.borderWidth = 2.0f;
  directions.layer.borderColor = [UIColor whiteColor].CGColor;
  directions.clipsToBounds = YES;
  directions.backgroundColor = [UIColor clearColor];
  [directions addTarget:self action:@selector(getDirections:) forControlEvents:UIControlEventTouchUpInside];
  [self.view addSubview:directions];
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/xCVgh.png" width="300" /></p>
  
  <p>I set these values as suggested and the border is never shown in the simulator.
  EDIT: I found out why the border wasn't showing up when setting these values in IB. The border color is a CGColor so I had to set it in code.</p>
  
  <p><img src="https://i.stack.imgur.com/Rfock.png" width="300" /></p>