I am trying to make a different corner radius for each corner on a UIView in an expanding tableview cell. I have a UIView with a UILabel as a subview. When there is a lot of text the UILabel expands, expanding the cell. What I am trying to do is make the corner radius of the UIView 13 on the top left and right corners and corner radius of 4 on the bottom corners.
Currently, I am using this question to round all corners with layer.cornerRadius which shows as
and then using this code
let maskPath = UIBezierPath(roundedRect: (originalCell?.messageBackground.bounds)!,
byRoundingCorners: [.bottomLeft, .bottomRight],
cornerRadii: CGSize(width: 13.0, height: 0.0))
let maskLayer = CAShapeLayer()
maskLayer.path = maskPath.cgPath
originalCell?.messageBackground.layer.mask = maskLayer
To try and round the bottom corners of the view, however when I do that the cell shows as this
So is there any way to round the top and bottom corners as different radius with expanding cells?