In my main view, I do some gesture action causing some new view to be shown. At this time I want to dim the entire background (except this new view) as a good UI practice. In HTML, Javascript it looks like so - How do I get this same effect in iOS ?
Inside the prepareForPopoverPresentation function, set the alpha of the background views to a value less than one. This will dim the background views when the popover is displayed.
Instead, if you want to dim stuff you need to do it yourself: create a full-screen UIView with a translucent background color (I find 66% black works best) then set its alpha to be 0. When you want things to dim, set the alpha to be 1.
Lay a UIView over the background, set its background to [UIColor blackColor]
and set its opacity to like 0.6. Then add that UIView to the parent view.
This'll dim out the background AND intercept any taps to background controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With