I am working in Xcode Version 6.1.1 and iOS 8.1 to develop my app in which I need round top-left and top-right corners in an image view according to design.
I have used the following code before, and it works correctly in previous versions of Xcode:
UIImageView *locationImage = (UIImageView *)[cell viewWithTag:101];
UIBezierPath *maskPath1;
maskPath1 = [UIBezierPath bezierPathWithRoundedRect:locationImage.bounds
byRoundingCorners:(UIRectCornerTopRight | UIRectCornerTopLeft)
cornerRadii:CGSizeMake(5.0, 5.0)];
CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
maskLayer1.frame = locationImage.bounds;
maskLayer1.path = maskPath1.CGPath;
locationImage.layer.mask = maskLayer1;
Now I get the top-left corner rounded but not the right one. I know the code is correct because if I apply it to a not constrained image view, it works well, but I need to constrain the items to the view. I use auto layout.
link to image: https://www.dropbox.com/s/orisd8gzbdhsr4z/round-corners.tiff?dl=0
There is something I am doing wrong? How can I round two corners properly?
Thanks in advance
*Sorry for my english