How to round only specific corners to a UIView in iOS using Swift
- July 01, 2019
- John Codeos
Sometimes you only want to round one or two corners from your
Use the following code to round specific corners:
As you see, for devices with iOS 10 and below, we use
UIBezierPath to draw the path on our
For iOS 11 and above, we use
maskedCorners in array.
Here’s the list of the corners:
.layerMinXMinYCorner = Top Left Corner
.layerMaxXMinYCorner = Top Right Corner
.layerMinXMaxYCorner = Bottom Left Corner
.layerMaxXMaxYCorder = Bottom Right Corner
If you have any questions feel free to DM me on Twitter @johncodeos or leave a comment below!