I would like to apply a blur effect to the existing view when an alert is shown on the screen, and I am currently doing this by displaying an imageView (BlurEffect:blurBackGroundSignUp
) on top of my view, hiding it initially and showing it when calling the following code:
[self BlurEffect:blurBackGroundSignUp];
The BlurEffect
method works as I get a blurred view when I put the code in the ViewDidLoad
method, but when I check for an alert or add the code to where I am displaying the alert it refuses to show. I am guessing there is something that needs to be overridden and I do not know how to do this.
In short, there's nothing in
UIAlertView
that would prevent the image view with the blurred image from showing up. So it's likely to be something simple.You will have to do some diagnostics to identify the source of the problem. The problem could be the snapshot itself. So pause execution at the point where the snapshot is created, hover over the
UIImage
variable which holds the blurred snapshot, click on the "Quick Look" button (looks like an eye; ), and confirm that the blurred image looks correct:The next thing is to check to make sure the image was added to an image view and that the image view added to the view hierarchy. You can continue execution of the app and then hit the view debug button :
Or you can run the app, hit the "pause" button, and at the
(lldb)
prompt enterpo [[UIWindow keyWindow] recursiveDescription]
. (You may want to temporarily pause theshow
of the alert view so we can focus on the other views in the view hierarchy). Anyway, you should see something like:Note, you'll notice in my first screen snapshot, I temporarily added a
tag
number to theblurredImageView
. The reason I do that is that it makes it easier to find the view in question in the view hierarchy shown above (it's the last line, the one that includedtag = 42
). Anyway, confirm that the image view containing the blurred image is in the view hierarchy, with a reasonableframe
and not hidden behind anything.