My code:
backgroundView.layer.cornerRadius = someValue
If your gray view is a subview of backgroundView, try to clip bounds:
backgroundView
backgroundView.clipToBounds = true