If you want to make any UIView blur just like 'Notification' bar screen then here is a simple code to make it happen.
This method will return a blur view and you can add that to your view as a sub view.
-(UIVisualEffectView*)createBlurrEffectView:(CGRect)bounds{
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.frame = bounds;
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
return blurEffectView;
}
Here is the method to add the blur view as a sub view.
-(void)addBlurViewToMyView{
[self.view addSubview:[self createBlurrEffectView:myView.bounds]];
}
Happy Coding!!!
0 Comment(s)