Mahin P Mahin P - 1 month ago 9
Objective-C Question

making uiview blur which contains a custom view which I want to remain unblured

I have 1custom uiview in my default view in viewcontroller. My need is that if a button is clicked my default main view goes to blur and custom view remains unchanged. And a button is clicked again the blured view returns to normal effect. I used the UIBlurEffect and UIVisualEffectView for making blur. But the problem is whole view got blured.

Answer

I've not tried the effects views yet, but they look as if they participate as good citizens in the view hierarchy. If that's true, then this should work...

// assume aView is the view you want blurred, and
// aSubview is the view you want to remain unburied

[aSubview removeFromSuperview];
// apply the effect view to aView
[aView addSubview:aSubview];
Comments