Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add border as property so it could be removed later. #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion UIView+Borders.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

@interface UIView (Borders)

@property (nonatomic, strong) CALayer *topBorder;
@property (nonatomic, strong) CALayer *bottomBorder;
@property (nonatomic, strong) CALayer *leftBorder;
@property (nonatomic, strong) CALayer *rightBorder;

@property (nonatomic, strong) UIView *vb_topBorder;
@property (nonatomic, strong) UIView *vb_bottomBorder;
@property (nonatomic, strong) UIView *vb_leftBorder;
@property (nonatomic, strong) UIView *vb_rightBorder;

/* Create your borders and assign them to a property on a view when you can via the create methods when possible. Otherwise you might end up with multiple borders being created.
*/

Expand All @@ -19,7 +29,8 @@
-(UIView*)createViewBackedTopBorderWithHeight: (CGFloat)height andColor:(UIColor*)color;
-(void)addTopBorderWithHeight:(CGFloat)height andColor:(UIColor*)color;
-(void)addViewBackedTopBorderWithHeight:(CGFloat)height andColor:(UIColor*)color;

- (void)removeTopBorder;
- (void)removeViewBackedTopBorder;

///------------
/// Top Border + Offsets
Expand All @@ -38,6 +49,8 @@
-(UIView*)createViewBackedRightBorderWithWidth: (CGFloat)width andColor:(UIColor*)color;
-(void)addRightBorderWithWidth: (CGFloat)width andColor:(UIColor*)color;
-(void)addViewBackedRightBorderWithWidth: (CGFloat)width andColor:(UIColor*)color;
- (void)removeRightBorder;
- (void)removeViewBackedRightBorder;

///------------
/// Right Border + Offsets
Expand All @@ -56,6 +69,8 @@
-(UIView*)createViewBackedBottomBorderWithHeight: (CGFloat)height andColor:(UIColor*)color;
-(void)addBottomBorderWithHeight:(CGFloat)height andColor:(UIColor*)color;
-(void)addViewBackedBottomBorderWithHeight:(CGFloat)height andColor:(UIColor*)color;
- (void)removeBottomBorder;
- (void)removeViewBackedBottomBorder;

///------------
/// Bottom Border + Offsets
Expand All @@ -74,6 +89,8 @@
-(UIView*)createViewBackedLeftBorderWithWidth: (CGFloat)width andColor:(UIColor*)color;
-(void)addLeftBorderWithWidth: (CGFloat)width andColor:(UIColor*)color;
-(void)addViewBackedLeftBorderWithWidth: (CGFloat)width andColor:(UIColor*)color;
- (void)removeLeftBorder;
- (void)removeViewBackedLeftBorder;

///------------
/// Left Border + Offsets
Expand Down
Loading