I would like to get this result:
I tried this in my view controller:
override func viewDidLoad() {
roundView.layer.cornerRadius = 10.0
let blueView = UIView(frame: CGRect(origin: .zero,
size: CGSize(width: 5, height: roundView.bounds.height)))
blueView.backgroundColor = .blue
blueView.clipsToBounds = true
roundView.addSubview(blueView)
}
But I'm getting this result:
How can I achieve this result?
Thank you for your help


Try this code, as here you need to set super view clip to bound property true, not to it's subview.