I want to create a custom Alert. So I inserted a content UIView with some width and height and the remaining area I want to look dim.
Below ideas I've tried but no luck
1- In Storyboard I set background custom color black and opacity 35%. But After a few second background is turning black.
2- Also tried to set background opacity in UIViewController by using below code, but not working.
view.backgroundColor = UIColor.black.withAlphaComponent(0.35)
any help would be appreciated. Thanks in advance

I would like to share what worked for me. I am using
Xcode 10.3andSwift 5Step 1- In
StoryboardI setUIViewbackground custom color black andopacity 35%.Step 2- Presented the
ViewControllerusing the bellow chunk of code.