As we know some iOS Native app use our home page background with Blur as their own background. And I'm just curious if we set background just like they do in our own app?
Here's the background of those app:
Thanks! :)
As we know some iOS Native app use our home page background with Blur as their own background. And I'm just curious if we set background just like they do in our own app?
Here's the background of those app:
Thanks! :)
Before IOS 8, you can generate a background image like the following code:
- (UIImage*)getBlurredImage {
// You will want to calculate this in code based on the view you will be presenting.
CGSize size = CGSizeMake(200,200);
UIGraphicsBeginImageContext(size);
[view drawViewHierarchyInRect:(CGRect){CGPointZero, w, h} afterScreenUpdates:YES]; // view is the view you are grabbing the screen shot of. The view that is to be blurred.
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// Gaussian Blur
image = [image applyLightEffect];
// Box Blur
// image = [image boxblurImageWithBlur:0.2f];
return image;
}
After IOS 8
// 1
let blurEffect = UIBlurEffect(style: .Light)
// 2
let blurView = UIVisualEffectView(effect: blurEffect)
// 3
blurView.setTranslatesAutoresizingMaskIntoConstraints(false)
view.insertSubview(blurView, atIndex: 0)
For more details, see this great tutorial : http://www.raywenderlich.com/84043/ios-8-visual-effects-tutorial