├── DRCornerViewDemo ├── .DS_Store ├── DRCornerViewDemo │ ├── 03.jpg │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── desc.imageset │ │ │ ├── desc.png │ │ │ ├── desc@2x.png │ │ │ ├── desc@3x.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── .DS_Store │ ├── button_bg@2x.png │ ├── ViewController.h │ ├── ChooseViewController.h │ ├── TestCornerViewController.h │ ├── LargeSumOfCornerCell.h │ ├── AppDelegate.h │ ├── main.m │ ├── Corner1Cell.h │ ├── ChooseViewController.m │ ├── Info.plist │ ├── UIView+DRCorner.h │ ├── ViewController.m │ ├── LargeSumOfCornerCell.m │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Corner1Cell.m │ ├── AppDelegate.m │ ├── TestCornerViewController.m │ ├── Corner1Cell.xib │ └── UIView+DRCorner.m ├── DRCornerViewDemo.xcodeproj │ ├── xcuserdata │ │ ├── apple.xcuserdatad │ │ │ ├── xcdebugger │ │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ │ ├── xcschememanagement.plist │ │ │ │ └── DRCornerViewDemo.xcscheme │ │ └── liyakun.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── DRCornerViewDemo.xcscheme │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ ├── apple.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── liyakun.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── project.pbxproj ├── DRCornerViewDemoTests │ ├── Info.plist │ └── DRCornerViewDemoTests.m └── DRCornerViewDemoUITests │ ├── Info.plist │ └── DRCornerViewDemoUITests.m └── README.md /DRCornerViewDemo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/.DS_Store -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo/03.jpg -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo/.DS_Store -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/button_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo/button_bg@2x.png -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/desc.png -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/desc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/desc@2x.png -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/desc@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/desc@3x.png -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/xcuserdata/liyakun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/project.xcworkspace/xcuserdata/liyakun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitKun/DRCornerViewExtension/HEAD/DRCornerViewDemo/DRCornerViewDemo.xcodeproj/project.xcworkspace/xcuserdata/liyakun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/ChooseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChooseViewController.h 3 | // DRCornerViewDemo 4 | // 5 | // Created by DRTerry on 2017/3/8. 6 | // Copyright © 2017年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ChooseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/TestCornerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestCornerViewController.h 3 | // DRCornerViewDemo 4 | // 5 | // Created by DRTerry on 2017/3/8. 6 | // Copyright © 2017年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestCornerViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/LargeSumOfCornerCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LargeSumOfCornerCell.h 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LargeSumOfCornerCell : UITableViewCell 12 | 13 | - (void)show; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Corner1Cell.h: -------------------------------------------------------------------------------- 1 | // 2 | // Corner1Cell.h 3 | // DRCornerViewDemo 4 | // 5 | // Created by DRTerry on 2017/3/8. 6 | // Copyright © 2017年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Corner1Cell : UITableViewCell 12 | 13 | - (void)cornerTop; 14 | 15 | - (void)cornerBottom; 16 | 17 | - (void)clearCurrentCorner; 18 | 19 | - (void)updateUIWithInfo:(NSString *)infoDict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/desc.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "desc.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "desc@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "desc@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DRCornerViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1805F0591C8D2DF700AC918B 16 | 17 | primary 18 | 19 | 20 | 1805F0721C8D2DF700AC918B 21 | 22 | primary 23 | 24 | 25 | 1805F07D1C8D2DF700AC918B 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/xcuserdata/liyakun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DRCornerViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1805F0591C8D2DF700AC918B 16 | 17 | primary 18 | 19 | 20 | 1805F0721C8D2DF700AC918B 21 | 22 | primary 23 | 24 | 25 | 1805F07D1C8D2DF700AC918B 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/ChooseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChooseViewController.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by DRTerry on 2017/3/8. 6 | // Copyright © 2017年 kun. All rights reserved. 7 | // 8 | 9 | #import "ChooseViewController.h" 10 | 11 | @interface ChooseViewController () 12 | 13 | @end 14 | 15 | @implementation ChooseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.title = @"选择界面"; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | /* 29 | #pragma mark - Navigation 30 | 31 | // In a storyboard-based application, you will often want to do a little preparation before navigation 32 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 33 | // Get the new view controller using [segue destinationViewController]. 34 | // Pass the selected object to the new view controller. 35 | } 36 | */ 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemoTests/DRCornerViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRCornerViewDemoTests.m 3 | // DRCornerViewDemoTests 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DRCornerViewDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DRCornerViewDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemoUITests/DRCornerViewDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRCornerViewDemoUITests.m 3 | // DRCornerViewDemoUITests 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DRCornerViewDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DRCornerViewDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/UIView+DRCorner.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+DRCorner.h 3 | // 正确圆角设置方式 4 | // 5 | // Created by apple on 16/3/2. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface UIView (DRCorner) 13 | 14 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor; 15 | 16 | - (void)dr_topCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor; 17 | 18 | - (void)dr_bottomCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor; 19 | /** 20 | * @brief 圆角化视图并对圆角部分进行描边 21 | * 22 | * @param radius 圆角的半径 23 | * @param bgColor 父视图的背景色 24 | * @param borderColor 描边的颜色 25 | */ 26 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor borderColor:(UIColor *)borderColor; 27 | 28 | - (void)removeDRCorner; 29 | 30 | - (BOOL)hasDRCornered; 31 | 32 | #pragma mark --- 新增加(xib文件创建的view且能获得准确的bounds时使用) 33 | 34 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor corenrRect:(CGRect)bounds; 35 | 36 | - (void)dr_topCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor corenrRect:(CGRect)bounds; 37 | 38 | - (void)dr_bottomCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor corenrRect:(CGRect)bounds; 39 | 40 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor borderColor:(UIColor *)borderColor corenrRect:(CGRect)bounds; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LargeSumOfCornerCell.h" 11 | 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | self.title = @"大量圆角"; 23 | self.automaticallyAdjustsScrollViewInsets = NO; 24 | } 25 | 26 | 27 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 28 | return 1; 29 | } 30 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 31 | return 50; 32 | } 33 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 34 | return 120; 35 | } 36 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 37 | LargeSumOfCornerCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LargeSumOfCornerCellID"]; 38 | 39 | return cell; 40 | } 41 | //在这里填充数据 42 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 43 | LargeSumOfCornerCell *lCell = (LargeSumOfCornerCell *)cell; 44 | 45 | [lCell show]; 46 | } 47 | 48 | 49 | - (void)didReceiveMemoryWarning { 50 | [super didReceiveMemoryWarning]; 51 | // Dispose of any resources that can be recreated. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/LargeSumOfCornerCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // LargeSumOfCornerCell.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "LargeSumOfCornerCell.h" 10 | #import "UIView+DRCorner.h" 11 | 12 | @interface LargeSumOfCornerCell () 13 | 14 | @property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *imagesCollection; 15 | 16 | @property (strong, nonatomic) IBOutletCollection(UILabel) NSArray *labelsCollection; 17 | 18 | @property (weak, nonatomic) IBOutlet UIButton *button; 19 | 20 | @property (nonatomic, assign) BOOL drCornered; 21 | 22 | @end 23 | 24 | @implementation LargeSumOfCornerCell 25 | 26 | - (void)awakeFromNib { 27 | [super awakeFromNib]; 28 | } 29 | 30 | - (void)show { 31 | if (!_drCornered) { 32 | _drCornered = YES; 33 | for (UIImageView *imageView in self.imagesCollection) { 34 | [imageView dr_cornerWithRadius:CGRectGetHeight(imageView.bounds)/2 backgroundColor:self.contentView.backgroundColor borderColor:[UIColor colorWithRed:214/255.0 green:34/255.0 blue:56/255.0 alpha:1]]; 35 | } 36 | for (UILabel *label in self.labelsCollection) { 37 | [label dr_cornerWithRadius:6.0 backgroundColor:self.contentView.backgroundColor]; 38 | } 39 | [self.button dr_cornerWithRadius:10.0 backgroundColor:self.contentView.backgroundColor]; 40 | [self.contentView dr_cornerWithRadius:10 backgroundColor:[UIColor whiteColor]]; 41 | } 42 | 43 | } 44 | 45 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 46 | [super setSelected:selected animated:animated]; 47 | 48 | // Configure the view for the selected state 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Corner1Cell.m: -------------------------------------------------------------------------------- 1 | // 2 | // Corner1Cell.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by DRTerry on 2017/3/8. 6 | // Copyright © 2017年 kun. All rights reserved. 7 | // 8 | 9 | #import "Corner1Cell.h" 10 | #import "UIView+DRCorner.h" 11 | 12 | @interface Corner1Cell () 13 | 14 | @property (weak, nonatomic) IBOutlet UIView *bgView; 15 | @property (weak, nonatomic) IBOutlet UIImageView *iconImage; 16 | @property (weak, nonatomic) IBOutlet UILabel *infoLabel; 17 | 18 | @property (nonatomic, assign) BOOL topCorner; 19 | @property (nonatomic, assign) BOOL bottomCorner; 20 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *horizontalSpace; 21 | 22 | @end 23 | 24 | @implementation Corner1Cell 25 | 26 | - (void)awakeFromNib { 27 | [super awakeFromNib]; 28 | // Initialization code 29 | } 30 | 31 | - (void)layoutSubviews { 32 | [super layoutSubviews]; 33 | CGFloat selfHeight = CGRectGetHeight(self.bounds); 34 | CGFloat selfWidth = CGRectGetWidth(self.bounds); 35 | if (self.topCorner) { 36 | [self.bgView dr_topCornerWithRadius:5.0 backgroundColor:self.backgroundColor corenrRect:CGRectMake(0, 0, selfWidth - 2 * _horizontalSpace.constant, selfHeight)]; 37 | } 38 | if (self.bottomCorner) { 39 | [self.bgView dr_bottomCornerWithRadius:5.0 backgroundColor:self.backgroundColor corenrRect:CGRectMake(0, 0, selfWidth - 2 * _horizontalSpace.constant, selfHeight)]; 40 | } 41 | } 42 | 43 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 44 | [super setSelected:selected animated:animated]; 45 | } 46 | 47 | - (void)cornerTop { 48 | self.topCorner = YES; 49 | } 50 | 51 | - (void)cornerBottom { 52 | self.bottomCorner = YES; 53 | } 54 | 55 | - (void)clearCurrentCorner { 56 | self.topCorner = NO; 57 | self.bottomCorner = NO; 58 | [self.bgView removeDRCorner]; 59 | } 60 | 61 | - (void)updateUIWithInfo:(NSString *)infoDict { 62 | 63 | } 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by apple on 16/3/7. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/TestCornerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestCornerViewController.m 3 | // DRCornerViewDemo 4 | // 5 | // Created by DRTerry on 2017/3/8. 6 | // Copyright © 2017年 kun. All rights reserved. 7 | // 8 | 9 | #import "TestCornerViewController.h" 10 | #import "Corner1Cell.h" 11 | 12 | @interface TestCornerViewController () 13 | 14 | @property (nonatomic, strong) NSMutableArray *dataArray; 15 | 16 | @end 17 | 18 | @implementation TestCornerViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.title = @"自定义的圆角"; 23 | self.automaticallyAdjustsScrollViewInsets = NO; 24 | } 25 | 26 | 27 | - (NSMutableArray *)dataArray { 28 | if (!_dataArray) { 29 | self.dataArray = [[NSMutableArray alloc] init]; 30 | NSInteger totla = arc4random()%4 + 2; 31 | for (NSInteger i = 0; i < totla; i++) { 32 | [_dataArray addObject:@"图标说明(名称)"]; 33 | } 34 | } 35 | return _dataArray; 36 | } 37 | 38 | #pragma mark ---- UITableViewDataSource && UITableViewDelegate 39 | 40 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 41 | return 1; 42 | } 43 | 44 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 45 | return self.dataArray.count; 46 | } 47 | 48 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 49 | return 45.0; 50 | } 51 | 52 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 53 | Corner1Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"Corner1CellID"]; 54 | if (!cell) { 55 | cell = [[[NSBundle mainBundle] loadNibNamed:@"Corner1Cell" owner:self options:nil] lastObject]; 56 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 57 | } 58 | return cell; 59 | } 60 | 61 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 62 | Corner1Cell *tCell = (Corner1Cell *)cell; 63 | if (indexPath.row == 0) { 64 | [tCell cornerTop]; 65 | }else if (indexPath.row == _dataArray.count -1) { 66 | [tCell cornerBottom]; 67 | }else { 68 | [tCell clearCurrentCorner]; 69 | } 70 | NSString *infoStr = _dataArray[indexPath.row]; 71 | [tCell updateUIWithInfo:infoStr]; 72 | } 73 | 74 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 75 | NSLog(@"Selected at index : %ld",(long)indexPath.row); 76 | } 77 | 78 | 79 | - (void)didReceiveMemoryWarning { 80 | [super didReceiveMemoryWarning]; 81 | // Dispose of any resources that can be recreated. 82 | } 83 | 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DRCornerViewExtension 2 | 我所理解的设置圆角的方式,无离屏渲染,无mask 使用 CAShaperLayer 实现 轻量级应用 3 | Extension 来实现 欢迎star 4 | 5 | **swift 版本如下** 6 | [DRCorner_Swift](https://github.com/gitKun/DRCorner_Swift) 7 | 8 | *使用 maskToBounds 和 cornerRadius 或者 mask 时 造成的离屏渲染(如下图)* 9 | 10 | ![maskToBounds.png](https://ooo.0o0.ooo/2016/03/07/56dd3a7c15eb7.png) 11 | 12 | *使用 UIView+Corner 时的UIImageView* 13 | 14 | ![imageCorner.jpg](https://ooo.0o0.ooo/2016/03/07/56dd3a04bdf1a.jpg) 15 | 16 | *使用 UIView+Corner 时的UILabel* 17 | 18 | ![labelCorner.png](https://ooo.0o0.ooo/2016/03/07/56dd3b70742d2.png) 19 | 20 | 21 | *核心代码* 22 | 23 | ``` 24 | - (void)dr_roundingCorner:(DRRoundCorner)roundCorner radius:(CGFloat)radius backgroundColor:(UIColor *)bgColor borderColor:(UIColor *)borderColor { 25 | [self removeDRCorner]; 26 | CGFloat width = CGRectGetWidth(self.bounds); 27 | CGFloat height = CGRectGetHeight(self.bounds); 28 | UIBezierPath * path= [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, width, height)]; 29 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 30 | shapeLayer.name = DRCornerLayerName; 31 | UIRectCorner sysCorner = (UIRectCorner)roundCorner; 32 | UIBezierPath *cornerPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:sysCorner cornerRadii:CGSizeMake(radius, radius)]; 33 | [path appendPath:cornerPath]; 34 | //[path setUsesEvenOddFillRule:YES]; 35 | shapeLayer.path = path.CGPath; 36 | shapeLayer.fillRule = kCAFillRuleEvenOdd; 37 | shapeLayer.fillColor = bgColor.CGColor; 38 | if (borderColor) { 39 | //CGPathApply 40 | CGFloat cornerPathLength = lengthOfCGPath(roundCorner,radius,self.bounds.size); 41 | CGFloat totolPathLength = 2*(CGRectGetHeight(self.bounds)+CGRectGetWidth(self.bounds))+cornerPathLength; 42 | shapeLayer.strokeStart = (totolPathLength-cornerPathLength)/totolPathLength; 43 | shapeLayer.strokeEnd = 1.0; 44 | shapeLayer.strokeColor = borderColor.CGColor; 45 | } 46 | if ([self isKindOfClass:[UILabel class]]) { 47 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 48 | [self.layer addSublayer:shapeLayer]; 49 | }); 50 | return; 51 | } 52 | [self.layer addSublayer:shapeLayer]; 53 | } 54 | 55 | ``` 56 | 57 | *本方法会有图层混合的问题 下面附上 该demo 的真机测试图 机器是 5c* 58 | 59 | ![图层混合.png](https://ooo.0o0.ooo/2016/03/07/56dd780deb8b6.png) 60 | 61 | ##补充 62 | 63 | 1. *git* 已经更新 新增加了 *-topCorner* ; *-bottomCorner* ; 和 *-removeCorner* ; *-(BOOL)hasDRCornered* ;方法,并且现在你在多次给同一视图添加圆角时也不会出现性能问题了。 64 | 65 | 2. *git*代码已更新,添加了传入需要圆角的正确`bounds`,因此对于`xib`创建的`view`添加圆角就需要你在能获取到正确`frame`的地方在去添加圆角,具体的实现在最新代码中都已经给出. 66 | 67 | 3. 如果你不能获得每个`subview`的实际`bounds`,那么这里在给你提供一种不是那么`轻量级`的实现,通过交换`-layoutSubviews`方法,在自己的`dr_layoutSubviews`实现中,判断是否给`self`添加了圆角,如果是,则创建一个`dr_maskView`将,在`- dr_roundingCorner: radius: backgroundColor: borderColor:`中保存的设置,通过调用`-addMaskLayerToSubView: cornerType: radius: bgColor: borderColor: `方法给`dr_maskView`添加圆角,并将`dr_maskView`的`userInteractionEnabled`设置为`NO`后添加到`self`的最顶层. 68 | 69 | 在`UIView+DRCorner.m`中重写`+load`方法利用`runtime`来交换一下`UIView`的`-layoutSubviews`方法: 70 | 71 | ``` 72 | + (void)load { 73 | static dispatch_once_t onceToken; 74 | dispatch_once(&onceToken, ^{ 75 | Method originalLayoutSubviewsMethod = class_getInstanceMethod(self, @selector(layoutSubviews)); 76 | Method swizzledLayoutSubviewsMethod = class_getInstanceMethod(self, @selector(dr_layoutSubviews)); 77 | method_exchangeImplementations(originalLayoutSubviewsMethod, swizzledLayoutSubviewsMethod); 78 | }); 79 | } 80 | 81 | -(void)dr_layoutSubviews { 82 | [self dr_layoutSubviews]; 83 | //这里判断是否掉用过添加圆角的方法(本人用`runtime`在添加圆角的方法中动态添加了一个属性字典给self,因此这里只需要获取一下这个字典看是否存在) 84 | //添加过圆角就实现`dr_maskView`的创建,绘制圆角,添加到self操作 85 | ... 86 | } 87 | ``` 88 | 89 | 具体实现就不写了,感觉这种方式并不怎么轻量级,和原本设计的有些不相符[dog脸] 90 | 91 | *增加了描边功能,效果图如下* 92 | 93 | ![增加描边.png](https://ooo.0o0.ooo/2016/03/08/56ded2ae99ad8.png) 94 | 95 | 96 | **个人原创请star支持,拜谢** 97 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/DRCornerViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/xcuserdata/liyakun.xcuserdatad/xcschemes/DRCornerViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Corner1Cell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/UIView+DRCorner.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+DRCorner.m 3 | // 正确圆角设置方式 4 | // 5 | // Created by apple on 16/3/2. 6 | // Copyright © 2016年 kun. All rights reserved. 7 | // 8 | 9 | #import "UIView+DRCorner.h" 10 | 11 | static NSString *DRCornerLayerName = @"DRCornerShapeLayer"; 12 | 13 | typedef NS_OPTIONS(NSUInteger, DRRoundCorner) { 14 | DRRoundCornerTop = (UIRectCornerTopLeft | UIRectCornerTopRight), 15 | DRRoundCornerBottom = (UIRectCornerBottomLeft | UIRectCornerBottomRight), 16 | DRRoundCornerAll = UIRectCornerAllCorners 17 | }; 18 | 19 | @implementation UIView (DRCorner) 20 | 21 | - (void)dr_roundingCorner:(DRRoundCorner)roundCorner radius:(CGFloat)radius backgroundColor:(UIColor *)bgColor borderColor:(UIColor *)borderColor corenrRect:(CGRect)bounds { 22 | [self removeDRCorner]; 23 | CGRect cornerBounds = CGRectEqualToRect(bounds, CGRectZero) ? self.bounds : bounds; 24 | CGFloat width = CGRectGetWidth(cornerBounds); 25 | CGFloat height = CGRectGetHeight(cornerBounds); 26 | UIBezierPath * path= [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, width, height)]; 27 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 28 | shapeLayer.name = DRCornerLayerName; 29 | UIRectCorner sysCorner = (UIRectCorner)roundCorner; 30 | UIBezierPath *cornerPath = [UIBezierPath bezierPathWithRoundedRect:cornerBounds byRoundingCorners:sysCorner cornerRadii:CGSizeMake(radius, radius)]; 31 | [path appendPath:cornerPath]; 32 | //[path setUsesEvenOddFillRule:YES]; 33 | shapeLayer.path = path.CGPath; 34 | /* 35 | 字面意思是“奇偶”。按该规则,要判断一个点是否在图形内,从该点作任意方向的一条射线,然后检测射线与图形路径的交点的数量。如果结果是奇数则认为点在内部,是偶数则认为点在外部 36 | */ 37 | shapeLayer.fillRule = kCAFillRuleEvenOdd; 38 | shapeLayer.fillColor = bgColor.CGColor; 39 | if (borderColor) { 40 | //CGPathApply 41 | CGFloat cornerPathLength = lengthOfCGPath(roundCorner,radius,cornerBounds.size); 42 | CGFloat totolPathLength = 2*(CGRectGetHeight(cornerBounds)+CGRectGetWidth(cornerBounds))+cornerPathLength; 43 | shapeLayer.strokeStart = (totolPathLength-cornerPathLength)/totolPathLength; 44 | shapeLayer.strokeEnd = 1.0; 45 | shapeLayer.strokeColor = borderColor.CGColor; 46 | } 47 | if ([self isKindOfClass:[UILabel class]]) { 48 | //UILabel 机制不一样的 UILabel 设置 text 为 中文 也会造成图层混合 (iOS8 之后UILabel的layer层改成了 _UILabelLayer 具体可阅读 http://www.jianshu.com/p/db6602413fa3 ) 49 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 50 | [self.layer addSublayer:shapeLayer]; 51 | }); 52 | return; 53 | } 54 | [self.layer addSublayer:shapeLayer]; 55 | } 56 | 57 | - (void)dr_roundingCorner:(DRRoundCorner)roundCorner radius:(CGFloat)radius backgroundColor:(UIColor *)bgColor { 58 | [self dr_roundingCorner:roundCorner radius:radius backgroundColor:bgColor borderColor:nil corenrRect:CGRectZero]; 59 | } 60 | 61 | /** 62 | 关于 CGPath 的 length 的计算请参看 http://www.mlsite.net/blog/?p=1312 与 http://stackoverflow.com/questions/6515158/get-info-about-a-cgpath-uibezierpath 在这里简单的计算就能满足要求因此不做过多讨论 63 | */ 64 | float lengthOfCGPath (DRRoundCorner roundingCorner,CGFloat radius,CGSize size) { 65 | CGFloat totolLength = 0.0; 66 | switch (roundingCorner) { 67 | case DRRoundCornerTop: 68 | case DRRoundCornerBottom: 69 | totolLength = 2*(size.width + size.height) - 4*radius + (M_PI * radius); 70 | break; 71 | case DRRoundCornerAll: 72 | totolLength = 2*(size.width + size.height) - 8*radius + (M_PI * radius)*2; 73 | default: 74 | break; 75 | } 76 | return totolLength; 77 | } 78 | 79 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor { 80 | [self dr_cornerWithRadius:radius backgroundColor:bgColor corenrRect:CGRectZero]; 81 | } 82 | 83 | - (void)dr_topCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor { 84 | [self dr_topCornerWithRadius:radius backgroundColor:bgColor corenrRect:CGRectZero]; 85 | } 86 | 87 | - (void)dr_bottomCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor { 88 | [self dr_bottomCornerWithRadius:radius backgroundColor:bgColor corenrRect:CGRectZero]; 89 | } 90 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor borderColor:(UIColor *)borderColor { 91 | [self dr_cornerWithRadius:radius backgroundColor:bgColor borderColor:borderColor corenrRect:CGRectZero]; 92 | } 93 | 94 | #pragma mark --- 新增加 95 | 96 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor corenrRect:(CGRect)bounds { 97 | [self dr_roundingCorner:DRRoundCornerAll radius:radius backgroundColor:bgColor borderColor:[UIColor clearColor] corenrRect:bounds]; 98 | } 99 | 100 | - (void)dr_topCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor corenrRect:(CGRect)bounds { 101 | [self dr_roundingCorner:DRRoundCornerTop radius:radius backgroundColor:bgColor borderColor:[UIColor clearColor] corenrRect:bounds]; 102 | } 103 | 104 | - (void)dr_bottomCornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor corenrRect:(CGRect)bounds { 105 | [self dr_roundingCorner:DRRoundCornerBottom radius:radius backgroundColor:bgColor borderColor:[UIColor clearColor] corenrRect:bounds]; 106 | } 107 | 108 | - (void)dr_cornerWithRadius:(CGFloat)radius backgroundColor:(UIColor *)bgColor borderColor:(UIColor *)borderColor corenrRect:(CGRect)bounds { 109 | [self dr_roundingCorner:DRRoundCornerAll radius:radius backgroundColor:bgColor borderColor:borderColor corenrRect:bounds]; 110 | } 111 | 112 | 113 | -(void)removeDRCorner { 114 | if ([self hasDRCornered]) { 115 | CALayer *layer = nil; 116 | for (CALayer *subLayer in self.layer.sublayers) { 117 | if ([subLayer.name isEqualToString:DRCornerLayerName]) { 118 | layer = subLayer; 119 | } 120 | } 121 | [layer removeFromSuperlayer]; 122 | } 123 | } 124 | 125 | - (BOOL)hasDRCornered { 126 | for (CALayer *subLayer in self.layer.sublayers) { 127 | if ([subLayer isKindOfClass:[CAShapeLayer class]] && [subLayer.name isEqualToString:DRCornerLayerName]) { 128 | return YES; 129 | } 130 | } 131 | return NO; 132 | } 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 37 | 50 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 176 | 183 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | -------------------------------------------------------------------------------- /DRCornerViewDemo/DRCornerViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1805F05F1C8D2DF700AC918B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1805F05E1C8D2DF700AC918B /* main.m */; }; 11 | 1805F0621C8D2DF700AC918B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1805F0611C8D2DF700AC918B /* AppDelegate.m */; }; 12 | 1805F0651C8D2DF700AC918B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1805F0641C8D2DF700AC918B /* ViewController.m */; }; 13 | 1805F0681C8D2DF700AC918B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1805F0661C8D2DF700AC918B /* Main.storyboard */; }; 14 | 1805F06A1C8D2DF700AC918B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1805F0691C8D2DF700AC918B /* Assets.xcassets */; }; 15 | 1805F06D1C8D2DF700AC918B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1805F06B1C8D2DF700AC918B /* LaunchScreen.storyboard */; }; 16 | 1805F0781C8D2DF700AC918B /* DRCornerViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1805F0771C8D2DF700AC918B /* DRCornerViewDemoTests.m */; }; 17 | 1805F0831C8D2DF700AC918B /* DRCornerViewDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1805F0821C8D2DF700AC918B /* DRCornerViewDemoUITests.m */; }; 18 | 1805F0961C8D2EF000AC918B /* LargeSumOfCornerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1805F0951C8D2EF000AC918B /* LargeSumOfCornerCell.m */; }; 19 | 1805F09A1C8D343E00AC918B /* button_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1805F0991C8D343E00AC918B /* button_bg@2x.png */; }; 20 | A11DB3481E6FDB040001B4FA /* 03.jpg in Resources */ = {isa = PBXBuildFile; fileRef = A11DB3471E6FDB040001B4FA /* 03.jpg */; }; 21 | A11DB34B1E6FDCD20001B4FA /* UIView+DRCorner.m in Sources */ = {isa = PBXBuildFile; fileRef = A11DB34A1E6FDCD20001B4FA /* UIView+DRCorner.m */; }; 22 | A11DB34E1E6FDD570001B4FA /* TestCornerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A11DB34D1E6FDD560001B4FA /* TestCornerViewController.m */; }; 23 | A11DB3511E6FE00C0001B4FA /* ChooseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A11DB3501E6FE00C0001B4FA /* ChooseViewController.m */; }; 24 | A11DB3551E6FE1250001B4FA /* Corner1Cell.m in Sources */ = {isa = PBXBuildFile; fileRef = A11DB3531E6FE1250001B4FA /* Corner1Cell.m */; }; 25 | A11DB3561E6FE1250001B4FA /* Corner1Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A11DB3541E6FE1250001B4FA /* Corner1Cell.xib */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 1805F0741C8D2DF700AC918B /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 1805F0521C8D2DF700AC918B /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 1805F0591C8D2DF700AC918B; 34 | remoteInfo = DRCornerViewDemo; 35 | }; 36 | 1805F07F1C8D2DF700AC918B /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = 1805F0521C8D2DF700AC918B /* Project object */; 39 | proxyType = 1; 40 | remoteGlobalIDString = 1805F0591C8D2DF700AC918B; 41 | remoteInfo = DRCornerViewDemo; 42 | }; 43 | /* End PBXContainerItemProxy section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 1805F05A1C8D2DF700AC918B /* DRCornerViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DRCornerViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 1805F05E1C8D2DF700AC918B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | 1805F0601C8D2DF700AC918B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 1805F0611C8D2DF700AC918B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 1805F0631C8D2DF700AC918B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 51 | 1805F0641C8D2DF700AC918B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 52 | 1805F0671C8D2DF700AC918B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 1805F0691C8D2DF700AC918B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 1805F06C1C8D2DF700AC918B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 1805F06E1C8D2DF700AC918B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 1805F0731C8D2DF700AC918B /* DRCornerViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DRCornerViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 1805F0771C8D2DF700AC918B /* DRCornerViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DRCornerViewDemoTests.m; sourceTree = ""; }; 58 | 1805F0791C8D2DF700AC918B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | 1805F07E1C8D2DF700AC918B /* DRCornerViewDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DRCornerViewDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 1805F0821C8D2DF700AC918B /* DRCornerViewDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DRCornerViewDemoUITests.m; sourceTree = ""; }; 61 | 1805F0841C8D2DF700AC918B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | 1805F0941C8D2EF000AC918B /* LargeSumOfCornerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LargeSumOfCornerCell.h; sourceTree = ""; }; 63 | 1805F0951C8D2EF000AC918B /* LargeSumOfCornerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LargeSumOfCornerCell.m; sourceTree = ""; }; 64 | 1805F0991C8D343E00AC918B /* button_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_bg@2x.png"; sourceTree = ""; }; 65 | A11DB3471E6FDB040001B4FA /* 03.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 03.jpg; sourceTree = ""; }; 66 | A11DB3491E6FDCD20001B4FA /* UIView+DRCorner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DRCorner.h"; sourceTree = ""; }; 67 | A11DB34A1E6FDCD20001B4FA /* UIView+DRCorner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+DRCorner.m"; sourceTree = ""; }; 68 | A11DB34C1E6FDD560001B4FA /* TestCornerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestCornerViewController.h; sourceTree = ""; }; 69 | A11DB34D1E6FDD560001B4FA /* TestCornerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestCornerViewController.m; sourceTree = ""; }; 70 | A11DB34F1E6FE00C0001B4FA /* ChooseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChooseViewController.h; sourceTree = ""; }; 71 | A11DB3501E6FE00C0001B4FA /* ChooseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChooseViewController.m; sourceTree = ""; }; 72 | A11DB3521E6FE1250001B4FA /* Corner1Cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Corner1Cell.h; sourceTree = ""; }; 73 | A11DB3531E6FE1250001B4FA /* Corner1Cell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Corner1Cell.m; sourceTree = ""; }; 74 | A11DB3541E6FE1250001B4FA /* Corner1Cell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Corner1Cell.xib; sourceTree = ""; }; 75 | /* End PBXFileReference section */ 76 | 77 | /* Begin PBXFrameworksBuildPhase section */ 78 | 1805F0571C8D2DF700AC918B /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | 1805F0701C8D2DF700AC918B /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 1805F07B1C8D2DF700AC918B /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | /* End PBXFrameworksBuildPhase section */ 100 | 101 | /* Begin PBXGroup section */ 102 | 1805F0511C8D2DF700AC918B = { 103 | isa = PBXGroup; 104 | children = ( 105 | 1805F05C1C8D2DF700AC918B /* DRCornerViewDemo */, 106 | 1805F0761C8D2DF700AC918B /* DRCornerViewDemoTests */, 107 | 1805F0811C8D2DF700AC918B /* DRCornerViewDemoUITests */, 108 | 1805F05B1C8D2DF700AC918B /* Products */, 109 | ); 110 | sourceTree = ""; 111 | }; 112 | 1805F05B1C8D2DF700AC918B /* Products */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 1805F05A1C8D2DF700AC918B /* DRCornerViewDemo.app */, 116 | 1805F0731C8D2DF700AC918B /* DRCornerViewDemoTests.xctest */, 117 | 1805F07E1C8D2DF700AC918B /* DRCornerViewDemoUITests.xctest */, 118 | ); 119 | name = Products; 120 | sourceTree = ""; 121 | }; 122 | 1805F05C1C8D2DF700AC918B /* DRCornerViewDemo */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 1805F0901C8D2E0300AC918B /* Class */, 126 | 1805F0601C8D2DF700AC918B /* AppDelegate.h */, 127 | 1805F0611C8D2DF700AC918B /* AppDelegate.m */, 128 | A11DB34F1E6FE00C0001B4FA /* ChooseViewController.h */, 129 | A11DB3501E6FE00C0001B4FA /* ChooseViewController.m */, 130 | 1805F0631C8D2DF700AC918B /* ViewController.h */, 131 | 1805F0641C8D2DF700AC918B /* ViewController.m */, 132 | A11DB34C1E6FDD560001B4FA /* TestCornerViewController.h */, 133 | A11DB34D1E6FDD560001B4FA /* TestCornerViewController.m */, 134 | 1805F0941C8D2EF000AC918B /* LargeSumOfCornerCell.h */, 135 | 1805F0951C8D2EF000AC918B /* LargeSumOfCornerCell.m */, 136 | A11DB3521E6FE1250001B4FA /* Corner1Cell.h */, 137 | A11DB3531E6FE1250001B4FA /* Corner1Cell.m */, 138 | A11DB3541E6FE1250001B4FA /* Corner1Cell.xib */, 139 | A11DB3471E6FDB040001B4FA /* 03.jpg */, 140 | 1805F0991C8D343E00AC918B /* button_bg@2x.png */, 141 | 1805F0661C8D2DF700AC918B /* Main.storyboard */, 142 | 1805F0691C8D2DF700AC918B /* Assets.xcassets */, 143 | 1805F06B1C8D2DF700AC918B /* LaunchScreen.storyboard */, 144 | 1805F06E1C8D2DF700AC918B /* Info.plist */, 145 | 1805F05D1C8D2DF700AC918B /* Supporting Files */, 146 | ); 147 | path = DRCornerViewDemo; 148 | sourceTree = ""; 149 | }; 150 | 1805F05D1C8D2DF700AC918B /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 1805F05E1C8D2DF700AC918B /* main.m */, 154 | ); 155 | name = "Supporting Files"; 156 | sourceTree = ""; 157 | }; 158 | 1805F0761C8D2DF700AC918B /* DRCornerViewDemoTests */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 1805F0771C8D2DF700AC918B /* DRCornerViewDemoTests.m */, 162 | 1805F0791C8D2DF700AC918B /* Info.plist */, 163 | ); 164 | path = DRCornerViewDemoTests; 165 | sourceTree = ""; 166 | }; 167 | 1805F0811C8D2DF700AC918B /* DRCornerViewDemoUITests */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | 1805F0821C8D2DF700AC918B /* DRCornerViewDemoUITests.m */, 171 | 1805F0841C8D2DF700AC918B /* Info.plist */, 172 | ); 173 | path = DRCornerViewDemoUITests; 174 | sourceTree = ""; 175 | }; 176 | 1805F0901C8D2E0300AC918B /* Class */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | A11DB3491E6FDCD20001B4FA /* UIView+DRCorner.h */, 180 | A11DB34A1E6FDCD20001B4FA /* UIView+DRCorner.m */, 181 | ); 182 | name = Class; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXGroup section */ 186 | 187 | /* Begin PBXNativeTarget section */ 188 | 1805F0591C8D2DF700AC918B /* DRCornerViewDemo */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = 1805F0871C8D2DF700AC918B /* Build configuration list for PBXNativeTarget "DRCornerViewDemo" */; 191 | buildPhases = ( 192 | 1805F0561C8D2DF700AC918B /* Sources */, 193 | 1805F0571C8D2DF700AC918B /* Frameworks */, 194 | 1805F0581C8D2DF700AC918B /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | ); 200 | name = DRCornerViewDemo; 201 | productName = DRCornerViewDemo; 202 | productReference = 1805F05A1C8D2DF700AC918B /* DRCornerViewDemo.app */; 203 | productType = "com.apple.product-type.application"; 204 | }; 205 | 1805F0721C8D2DF700AC918B /* DRCornerViewDemoTests */ = { 206 | isa = PBXNativeTarget; 207 | buildConfigurationList = 1805F08A1C8D2DF700AC918B /* Build configuration list for PBXNativeTarget "DRCornerViewDemoTests" */; 208 | buildPhases = ( 209 | 1805F06F1C8D2DF700AC918B /* Sources */, 210 | 1805F0701C8D2DF700AC918B /* Frameworks */, 211 | 1805F0711C8D2DF700AC918B /* Resources */, 212 | ); 213 | buildRules = ( 214 | ); 215 | dependencies = ( 216 | 1805F0751C8D2DF700AC918B /* PBXTargetDependency */, 217 | ); 218 | name = DRCornerViewDemoTests; 219 | productName = DRCornerViewDemoTests; 220 | productReference = 1805F0731C8D2DF700AC918B /* DRCornerViewDemoTests.xctest */; 221 | productType = "com.apple.product-type.bundle.unit-test"; 222 | }; 223 | 1805F07D1C8D2DF700AC918B /* DRCornerViewDemoUITests */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = 1805F08D1C8D2DF700AC918B /* Build configuration list for PBXNativeTarget "DRCornerViewDemoUITests" */; 226 | buildPhases = ( 227 | 1805F07A1C8D2DF700AC918B /* Sources */, 228 | 1805F07B1C8D2DF700AC918B /* Frameworks */, 229 | 1805F07C1C8D2DF700AC918B /* Resources */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | 1805F0801C8D2DF700AC918B /* PBXTargetDependency */, 235 | ); 236 | name = DRCornerViewDemoUITests; 237 | productName = DRCornerViewDemoUITests; 238 | productReference = 1805F07E1C8D2DF700AC918B /* DRCornerViewDemoUITests.xctest */; 239 | productType = "com.apple.product-type.bundle.ui-testing"; 240 | }; 241 | /* End PBXNativeTarget section */ 242 | 243 | /* Begin PBXProject section */ 244 | 1805F0521C8D2DF700AC918B /* Project object */ = { 245 | isa = PBXProject; 246 | attributes = { 247 | LastUpgradeCheck = 0820; 248 | ORGANIZATIONNAME = kun; 249 | TargetAttributes = { 250 | 1805F0591C8D2DF700AC918B = { 251 | CreatedOnToolsVersion = 7.1.1; 252 | }; 253 | 1805F0721C8D2DF700AC918B = { 254 | CreatedOnToolsVersion = 7.1.1; 255 | TestTargetID = 1805F0591C8D2DF700AC918B; 256 | }; 257 | 1805F07D1C8D2DF700AC918B = { 258 | CreatedOnToolsVersion = 7.1.1; 259 | TestTargetID = 1805F0591C8D2DF700AC918B; 260 | }; 261 | }; 262 | }; 263 | buildConfigurationList = 1805F0551C8D2DF700AC918B /* Build configuration list for PBXProject "DRCornerViewDemo" */; 264 | compatibilityVersion = "Xcode 3.2"; 265 | developmentRegion = English; 266 | hasScannedForEncodings = 0; 267 | knownRegions = ( 268 | en, 269 | Base, 270 | ); 271 | mainGroup = 1805F0511C8D2DF700AC918B; 272 | productRefGroup = 1805F05B1C8D2DF700AC918B /* Products */; 273 | projectDirPath = ""; 274 | projectRoot = ""; 275 | targets = ( 276 | 1805F0591C8D2DF700AC918B /* DRCornerViewDemo */, 277 | 1805F0721C8D2DF700AC918B /* DRCornerViewDemoTests */, 278 | 1805F07D1C8D2DF700AC918B /* DRCornerViewDemoUITests */, 279 | ); 280 | }; 281 | /* End PBXProject section */ 282 | 283 | /* Begin PBXResourcesBuildPhase section */ 284 | 1805F0581C8D2DF700AC918B /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | A11DB3481E6FDB040001B4FA /* 03.jpg in Resources */, 289 | 1805F06D1C8D2DF700AC918B /* LaunchScreen.storyboard in Resources */, 290 | A11DB3561E6FE1250001B4FA /* Corner1Cell.xib in Resources */, 291 | 1805F06A1C8D2DF700AC918B /* Assets.xcassets in Resources */, 292 | 1805F09A1C8D343E00AC918B /* button_bg@2x.png in Resources */, 293 | 1805F0681C8D2DF700AC918B /* Main.storyboard in Resources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 1805F0711C8D2DF700AC918B /* Resources */ = { 298 | isa = PBXResourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | 1805F07C1C8D2DF700AC918B /* Resources */ = { 305 | isa = PBXResourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | }; 311 | /* End PBXResourcesBuildPhase section */ 312 | 313 | /* Begin PBXSourcesBuildPhase section */ 314 | 1805F0561C8D2DF700AC918B /* Sources */ = { 315 | isa = PBXSourcesBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | 1805F0651C8D2DF700AC918B /* ViewController.m in Sources */, 319 | A11DB34E1E6FDD570001B4FA /* TestCornerViewController.m in Sources */, 320 | A11DB3551E6FE1250001B4FA /* Corner1Cell.m in Sources */, 321 | 1805F0961C8D2EF000AC918B /* LargeSumOfCornerCell.m in Sources */, 322 | A11DB3511E6FE00C0001B4FA /* ChooseViewController.m in Sources */, 323 | 1805F0621C8D2DF700AC918B /* AppDelegate.m in Sources */, 324 | 1805F05F1C8D2DF700AC918B /* main.m in Sources */, 325 | A11DB34B1E6FDCD20001B4FA /* UIView+DRCorner.m in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | 1805F06F1C8D2DF700AC918B /* Sources */ = { 330 | isa = PBXSourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | 1805F0781C8D2DF700AC918B /* DRCornerViewDemoTests.m in Sources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | 1805F07A1C8D2DF700AC918B /* Sources */ = { 338 | isa = PBXSourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | 1805F0831C8D2DF700AC918B /* DRCornerViewDemoUITests.m in Sources */, 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | }; 345 | /* End PBXSourcesBuildPhase section */ 346 | 347 | /* Begin PBXTargetDependency section */ 348 | 1805F0751C8D2DF700AC918B /* PBXTargetDependency */ = { 349 | isa = PBXTargetDependency; 350 | target = 1805F0591C8D2DF700AC918B /* DRCornerViewDemo */; 351 | targetProxy = 1805F0741C8D2DF700AC918B /* PBXContainerItemProxy */; 352 | }; 353 | 1805F0801C8D2DF700AC918B /* PBXTargetDependency */ = { 354 | isa = PBXTargetDependency; 355 | target = 1805F0591C8D2DF700AC918B /* DRCornerViewDemo */; 356 | targetProxy = 1805F07F1C8D2DF700AC918B /* PBXContainerItemProxy */; 357 | }; 358 | /* End PBXTargetDependency section */ 359 | 360 | /* Begin PBXVariantGroup section */ 361 | 1805F0661C8D2DF700AC918B /* Main.storyboard */ = { 362 | isa = PBXVariantGroup; 363 | children = ( 364 | 1805F0671C8D2DF700AC918B /* Base */, 365 | ); 366 | name = Main.storyboard; 367 | sourceTree = ""; 368 | }; 369 | 1805F06B1C8D2DF700AC918B /* LaunchScreen.storyboard */ = { 370 | isa = PBXVariantGroup; 371 | children = ( 372 | 1805F06C1C8D2DF700AC918B /* Base */, 373 | ); 374 | name = LaunchScreen.storyboard; 375 | sourceTree = ""; 376 | }; 377 | /* End PBXVariantGroup section */ 378 | 379 | /* Begin XCBuildConfiguration section */ 380 | 1805F0851C8D2DF700AC918B /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 385 | CLANG_CXX_LIBRARY = "libc++"; 386 | CLANG_ENABLE_MODULES = YES; 387 | CLANG_ENABLE_OBJC_ARC = YES; 388 | CLANG_WARN_BOOL_CONVERSION = YES; 389 | CLANG_WARN_CONSTANT_CONVERSION = YES; 390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 391 | CLANG_WARN_EMPTY_BODY = YES; 392 | CLANG_WARN_ENUM_CONVERSION = YES; 393 | CLANG_WARN_INFINITE_RECURSION = YES; 394 | CLANG_WARN_INT_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 397 | CLANG_WARN_UNREACHABLE_CODE = YES; 398 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 399 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 400 | COPY_PHASE_STRIP = NO; 401 | DEBUG_INFORMATION_FORMAT = dwarf; 402 | ENABLE_STRICT_OBJC_MSGSEND = YES; 403 | ENABLE_TESTABILITY = YES; 404 | GCC_C_LANGUAGE_STANDARD = gnu99; 405 | GCC_DYNAMIC_NO_PIC = NO; 406 | GCC_NO_COMMON_BLOCKS = YES; 407 | GCC_OPTIMIZATION_LEVEL = 0; 408 | GCC_PREPROCESSOR_DEFINITIONS = ( 409 | "DEBUG=1", 410 | "$(inherited)", 411 | ); 412 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 413 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 414 | GCC_WARN_UNDECLARED_SELECTOR = YES; 415 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 416 | GCC_WARN_UNUSED_FUNCTION = YES; 417 | GCC_WARN_UNUSED_VARIABLE = YES; 418 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 419 | MTL_ENABLE_DEBUG_INFO = YES; 420 | ONLY_ACTIVE_ARCH = YES; 421 | SDKROOT = iphoneos; 422 | }; 423 | name = Debug; 424 | }; 425 | 1805F0861C8D2DF700AC918B /* Release */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ALWAYS_SEARCH_USER_PATHS = NO; 429 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 430 | CLANG_CXX_LIBRARY = "libc++"; 431 | CLANG_ENABLE_MODULES = YES; 432 | CLANG_ENABLE_OBJC_ARC = YES; 433 | CLANG_WARN_BOOL_CONVERSION = YES; 434 | CLANG_WARN_CONSTANT_CONVERSION = YES; 435 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 436 | CLANG_WARN_EMPTY_BODY = YES; 437 | CLANG_WARN_ENUM_CONVERSION = YES; 438 | CLANG_WARN_INFINITE_RECURSION = YES; 439 | CLANG_WARN_INT_CONVERSION = YES; 440 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 441 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 442 | CLANG_WARN_UNREACHABLE_CODE = YES; 443 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 444 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 445 | COPY_PHASE_STRIP = NO; 446 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 447 | ENABLE_NS_ASSERTIONS = NO; 448 | ENABLE_STRICT_OBJC_MSGSEND = YES; 449 | GCC_C_LANGUAGE_STANDARD = gnu99; 450 | GCC_NO_COMMON_BLOCKS = YES; 451 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 452 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 453 | GCC_WARN_UNDECLARED_SELECTOR = YES; 454 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 455 | GCC_WARN_UNUSED_FUNCTION = YES; 456 | GCC_WARN_UNUSED_VARIABLE = YES; 457 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 458 | MTL_ENABLE_DEBUG_INFO = NO; 459 | SDKROOT = iphoneos; 460 | VALIDATE_PRODUCT = YES; 461 | }; 462 | name = Release; 463 | }; 464 | 1805F0881C8D2DF700AC918B /* Debug */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 468 | INFOPLIST_FILE = DRCornerViewDemo/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = DR.Terry.com.DRCornerViewDemo; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | }; 473 | name = Debug; 474 | }; 475 | 1805F0891C8D2DF700AC918B /* Release */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 479 | INFOPLIST_FILE = DRCornerViewDemo/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = DR.Terry.com.DRCornerViewDemo; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | }; 484 | name = Release; 485 | }; 486 | 1805F08B1C8D2DF700AC918B /* Debug */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | BUNDLE_LOADER = "$(TEST_HOST)"; 490 | INFOPLIST_FILE = DRCornerViewDemoTests/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = DR.Terry.com.DRCornerViewDemoTests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DRCornerViewDemo.app/DRCornerViewDemo"; 495 | }; 496 | name = Debug; 497 | }; 498 | 1805F08C1C8D2DF700AC918B /* Release */ = { 499 | isa = XCBuildConfiguration; 500 | buildSettings = { 501 | BUNDLE_LOADER = "$(TEST_HOST)"; 502 | INFOPLIST_FILE = DRCornerViewDemoTests/Info.plist; 503 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 504 | PRODUCT_BUNDLE_IDENTIFIER = DR.Terry.com.DRCornerViewDemoTests; 505 | PRODUCT_NAME = "$(TARGET_NAME)"; 506 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DRCornerViewDemo.app/DRCornerViewDemo"; 507 | }; 508 | name = Release; 509 | }; 510 | 1805F08E1C8D2DF700AC918B /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | INFOPLIST_FILE = DRCornerViewDemoUITests/Info.plist; 514 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 515 | PRODUCT_BUNDLE_IDENTIFIER = DR.Terry.com.DRCornerViewDemoUITests; 516 | PRODUCT_NAME = "$(TARGET_NAME)"; 517 | TEST_TARGET_NAME = DRCornerViewDemo; 518 | USES_XCTRUNNER = YES; 519 | }; 520 | name = Debug; 521 | }; 522 | 1805F08F1C8D2DF700AC918B /* Release */ = { 523 | isa = XCBuildConfiguration; 524 | buildSettings = { 525 | INFOPLIST_FILE = DRCornerViewDemoUITests/Info.plist; 526 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 527 | PRODUCT_BUNDLE_IDENTIFIER = DR.Terry.com.DRCornerViewDemoUITests; 528 | PRODUCT_NAME = "$(TARGET_NAME)"; 529 | TEST_TARGET_NAME = DRCornerViewDemo; 530 | USES_XCTRUNNER = YES; 531 | }; 532 | name = Release; 533 | }; 534 | /* End XCBuildConfiguration section */ 535 | 536 | /* Begin XCConfigurationList section */ 537 | 1805F0551C8D2DF700AC918B /* Build configuration list for PBXProject "DRCornerViewDemo" */ = { 538 | isa = XCConfigurationList; 539 | buildConfigurations = ( 540 | 1805F0851C8D2DF700AC918B /* Debug */, 541 | 1805F0861C8D2DF700AC918B /* Release */, 542 | ); 543 | defaultConfigurationIsVisible = 0; 544 | defaultConfigurationName = Release; 545 | }; 546 | 1805F0871C8D2DF700AC918B /* Build configuration list for PBXNativeTarget "DRCornerViewDemo" */ = { 547 | isa = XCConfigurationList; 548 | buildConfigurations = ( 549 | 1805F0881C8D2DF700AC918B /* Debug */, 550 | 1805F0891C8D2DF700AC918B /* Release */, 551 | ); 552 | defaultConfigurationIsVisible = 0; 553 | defaultConfigurationName = Release; 554 | }; 555 | 1805F08A1C8D2DF700AC918B /* Build configuration list for PBXNativeTarget "DRCornerViewDemoTests" */ = { 556 | isa = XCConfigurationList; 557 | buildConfigurations = ( 558 | 1805F08B1C8D2DF700AC918B /* Debug */, 559 | 1805F08C1C8D2DF700AC918B /* Release */, 560 | ); 561 | defaultConfigurationIsVisible = 0; 562 | defaultConfigurationName = Release; 563 | }; 564 | 1805F08D1C8D2DF700AC918B /* Build configuration list for PBXNativeTarget "DRCornerViewDemoUITests" */ = { 565 | isa = XCConfigurationList; 566 | buildConfigurations = ( 567 | 1805F08E1C8D2DF700AC918B /* Debug */, 568 | 1805F08F1C8D2DF700AC918B /* Release */, 569 | ); 570 | defaultConfigurationIsVisible = 0; 571 | defaultConfigurationName = Release; 572 | }; 573 | /* End XCConfigurationList section */ 574 | }; 575 | rootObject = 1805F0521C8D2DF700AC918B /* Project object */; 576 | } 577 | --------------------------------------------------------------------------------