-3

In Xcode 6, I'm making a game in Objective-C and when you lose I want the view to be blurred. Kind of like this, but a little less blurred: enter image description here

rmaddy
  • 314,917
  • 42
  • 532
  • 579

2 Answers2

1

You will have to add a UIBlurEffect in a UIVisualEffectsView. Here is a good tutorial that might help you solve your problem.

I would recommend doing some research before asking, there are tons of tutorials out there and this question was asked several times before.

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
0

This code worked for me:

UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
[blurEffectView setFrame:self.view.bounds];
[self.view addSubview:blurEffectView];