mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 00:59:20 +00:00
27 lines
757 B
Objective-C
27 lines
757 B
Objective-C
//
|
|
// UIView+RoundUIView.m
|
|
// linphone
|
|
//
|
|
// Created by Jörg Platte on 16.01.13.
|
|
//
|
|
//
|
|
|
|
#import "UIView+RoundUIView.h"
|
|
#import <UIKit/UIKit.h>
|
|
#import <QuartzCore/QuartzCore.h>
|
|
|
|
@implementation UIView (RoundUIView)
|
|
|
|
- (void)makeRoundWithCorner:(UIRectCorner)rectCorner radius:(float)radius {
|
|
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds
|
|
byRoundingCorners:rectCorner
|
|
cornerRadii:CGSizeMake(radius, radius)];
|
|
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
maskLayer.frame = self.bounds;
|
|
maskLayer.path = maskPath.CGPath;
|
|
[self.layer setMask:maskLayer];
|
|
[maskLayer release];
|
|
}
|
|
|
|
|
|
@end
|