According to the documentation for UIVIew @property(nonatomic) CGFloat alpha
The value of this property is a floating-point number in the
Set Opacity of the background color instead of alpha will not affect its child views.
Or you can set by programmetically
var customView:UIView = UIView()
customView.layer.opacity = 0.3
Thats it. Happy Coding!!!