Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Non-opaque application windows in iOS 7, with optional blur. Shows the user's wallpaper under the app, with Parallax if supported.
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;
@end
[application _setBackgroundStyle:UIBackgroundStyleDarkBlur];
@goelv

This comment has been minimized.

Copy link

goelv commented Nov 3, 2013

Hi,

How can I use this in my application?

Where would I write/call this code?

Thanks,
Varun

@dariolass

This comment has been minimized.

Copy link

dariolass commented Nov 20, 2013

This private method has been removed by Apple due to privacy concerns.

@NSNic

This comment has been minimized.

Copy link

NSNic commented Apr 23, 2014

How can I retrieve the user's current wallpaper as an image in iOS 7,I have found a method called +(UIImage *)defaultDesktopImage that I can use to do that,however,it was only available in iOS 2-4.1,so what can I do to do this?Do you have any ideas,thanks in advance!

@NSExceptional

This comment has been minimized.

Copy link

NSExceptional commented Jul 14, 2016

Might I propose a change to the enum?

typedef NS_ENUM(NSUInteger, UIBackgroundStyle) {
    UIBackgroundStyleDefault,
    UIBackgroundStyleTransparent,
    UIBackgroundStyleLightBlur,
    UIBackgroundStyleDarkBlur,
    UIBackgroundStyleDarkTranslucent
};

A friend wanted to use it in Swift, an enums are properly imported to Swift with this syntax.

@NSExceptional

This comment has been minimized.

Copy link

NSExceptional commented Jul 14, 2016

@dariolass, it has not been removed as of iOS 9.0.2.

@AppleBetas

This comment has been minimized.

Copy link

AppleBetas commented Feb 11, 2017

In addition to what @ThePantsThief suggested, there are a few enum values that are actually left out that can make really nice blurs: https://gist.github.com/AppleBetas/4ddf91c8ead4b2a87a71bcd52eab258b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.