Skip to content

Instantly share code, notes, and snippets.

@palmin
Created March 31, 2015 20:25
Show Gist options
  • Save palmin/56c6347d5869cd29052c to your computer and use it in GitHub Desktop.
Save palmin/56c6347d5869cd29052c to your computer and use it in GitHub Desktop.
@interface UIView (InspectableBorder)
@property (nonatomic, assign) IBInspectable CGFloat borderWidth;
@property (nonatomic, assign) IBInspectable CGFloat cornerRadius;
@end
@implementation UIView (InspectableBorder)
-(CGFloat)borderWidth {
return self.layer.borderWidth;
}
-(void)setBorderWidth:(CGFloat)borderWidth {
self.layer.borderWidth = borderWidth;
}
-(CGFloat)cornerRadius {
return self.layer.cornerRadius;
}
-(void)setCornerRadius:(CGFloat)cornerRadius {
self.layer.cornerRadius = cornerRadius;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment