I’d like to create a function that essentially translucently greys out the screen. For example, if you hold the off button on an iPhone/iPad the screen greys out and gives you the option to turn off the device. I’d like to implement the same type of thing. If a function is called, grey out a screen and include a button on the screen, and if the button is pressed it goes back to normal.
My guess is that you would create some sort of new view and place it on top of the current view, but I am not sure how to do that.
Create a
UIViewsubclass that has a background color of[UIColor blackColor]and set the alpha value for that view to 0.5. When you add it as a subview over whatever you view you want to obscure, it should look roughly like the “Power Down” screen tint.Add a button to that (at full alpha) and it’ll look super slick.