项目介绍:
后面会陆续的进行维护,后期考虑添加
目前已经支持pod 'UIView+RITLBorders'
如果有帮助,欢迎Star
-
圆角控制
-
渐变色边缘
目前开放的接口如下:
/// 使用layer的borderWidth统一设置
- (void)ritl_addBorderWithInset:(UIEdgeInsets)inset
Color:(UIColor *)borderColor
direction:(RITLBorderDirection)directions;
/// 使用layer的borderColor统一设置
- (void)ritl_addBorderWithInset:(UIEdgeInsets)inset
BorderWidth:(CGFloat)borderWidth
direction:(RITLBorderDirection)directions;
/// 各项的间距为UIEdgeInsetsZero
- (void)ritl_addBorderWithColor:(UIColor *)borderColor
BodrerWidth:(CGFloat)borderWidth
direction:(RITLBorderDirection)directions;
/// 自定义的layer设置
- (void)ritl_addBorderWithInset:(UIEdgeInsets)inset
Color:(UIColor *)borderColor
BorderWidth:(CGFloat)borderWidth
direction:(RITLBorderDirection)directions;
/// 移除当前边框
- (void)ritl_removeBorders:(RITLBorderDirection)directions;
/// 移除所有追加的边框
- (void)ritl_removeAllBorders;
上面的实例设置代码如下:
[self.left ritl_addBorderWithColor:UIColor.blackColor BodrerWidth:2 direction:RITLBorderDirectionLeft];
[self.top ritl_addBorderWithColor:UIColor.orangeColor BodrerWidth:2 direction:RITLBorderDirectionTop];
[self.right ritl_addBorderWithColor:UIColor.greenColor BodrerWidth:2 direction:RITLBorderDirectionRight];
[self.bottom ritl_addBorderWithColor:UIColor.yellowColor BodrerWidth:2 direction:RITLBorderDirectionBottom];
#pragma mark -
[self.leftRight ritl_addBorderWithColor:UIColor.cyanColor BodrerWidth:2 direction:RITLBorderDirectionLeft|RITLBorderDirectionRight];
[self.topBottom ritl_addBorderWithColor:UIColor.purpleColor BodrerWidth:2 direction:RITLBorderDirectionTop|RITLBorderDirectionBottom];
[self.custom ritl_addBorderWithColor:UIColor.orangeColor BodrerWidth:1.5 direction:RITLBorderDirectionLeft];
[self.custom ritl_addBorderWithColor:UIColor.blueColor BodrerWidth:1 direction:RITLBorderDirectionTop];
[self.custom ritl_addBorderWithColor:UIColor.redColor BodrerWidth:2 direction:RITLBorderDirectionBottom];