I have a UITextField subclass that contains a UITextView used to display some text below the UITextField.
I'm trying to round bottom two corners of the UITextView with the following code but for some reason it's disappearing.
let maskPath = UIBezierPath(roundedRect: textView.bounds,
byRoundingCorners: ([.bottomRight, .bottomRight]),
cornerRadii: CGSize(width: 10.0, height: 10.0))
let maskLayer: CAShapeLayer = CAShapeLayer()
maskLayer.frame = textView.bounds
maskLayer.path = maskPath.cgPath
textView.layer.mask = maskLayer
Why?
I'm using AutoLayout to place the textView beneath the textField - perhaps AutoLayout is clashing with what I have going on here? Or am I not setting the maskLayer's coordinates correctly?