Last active
April 30, 2021 17:10
-
-
Save software-mariodiana/fc71b9a73c3c120c01a160847467c639 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "MDXEllipseView.h" | |
@interface MDXEllipseView () | |
@property (nonatomic, strong) UIColor* mdx_backgroundColor; | |
@end | |
IB_DESIGNABLE | |
@implementation MDXEllipseView | |
- (void)setBackgroundColor:(UIColor *)backgroundColor | |
{ | |
self.mdx_backgroundColor = backgroundColor; | |
[super setBackgroundColor:[UIColor clearColor]]; | |
} | |
- (void)drawRect:(CGRect)rect | |
{ | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
CGContextAddEllipseInRect(ctx, rect); | |
CGContextSetFillColorWithColor(ctx, [[self mdx_backgroundColor] CGColor]); | |
CGContextFillPath(ctx); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment