Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
UIBackdropView: Difference between revisions - iPhone Development Wiki

UIBackdropView: Difference between revisions

From iPhone Development Wiki
(adding formatting and a detail from twitter)
No edit summary
Line 2: Line 2:


It uses a [[CAFilter#gaussianBlur|gaussianBlur CAFilter]].<ref>https://twitter.com/conradev/status/380905728393117696</ref>
It uses a [[CAFilter#gaussianBlur|gaussianBlur CAFilter]].<ref>https://twitter.com/conradev/status/380905728393117696</ref>
Here is a sample of _UIBackdropView
<source lang="objc">
        Class UIBackDropView = objc_getClass("_UIBackdropView");
        if (UIBackDropView)
        {
            id settings = nil;
           
            Class _UIBackdropViewSettingsAdaptiveLight = objc_getClass("_UIBackdropViewSettingsAdaptiveLight");
            if (_UIBackdropViewSettingsAdaptiveLight)
            {
                settings = [_UIBackdropViewSettingsAdaptiveLight settingsForStyle:2060]; // 2060 is the system control center background view style
            }
           
            UIView * backView = (UIView *) [[UIBackDropView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)
                                                        autosizesToFitSuperview:YES
                                                                        settings:settings];
            [self addSubview:backView];
            [backView release];
        }
</source>


== References ==
== References ==

Revision as of 09:12, 10 March 2014

_UIBackdropView is a private class in UIKit.framework (iOS 7.0 +), which is used for the popular blur effects.

It uses a gaussianBlur CAFilter.[1]

Here is a sample of _UIBackdropView

        Class UIBackDropView = objc_getClass("_UIBackdropView");
        if (UIBackDropView)
        {
            id settings = nil;
            
            Class _UIBackdropViewSettingsAdaptiveLight = objc_getClass("_UIBackdropViewSettingsAdaptiveLight");
            if (_UIBackdropViewSettingsAdaptiveLight)
            {
                settings = [_UIBackdropViewSettingsAdaptiveLight settingsForStyle:2060]; // 2060 is the system control center background view style
            }
            
            UIView * backView = (UIView *) [[UIBackDropView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)
                                                         autosizesToFitSuperview:YES
                                                                        settings:settings];
            [self addSubview:backView];
            [backView release];
        }

References