Detect if device properly displays UIVisualEffectView?

后端 未结 2 981
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-04 07:17

My app utilizes UIVisualEffectView to blur the background just like Control Center. But I discovered the iPad 2 (and Retina iPad) which can run iOS 8 isn\'t pow

相关标签:
2条回答
  • 2021-01-04 07:56

    Check this WWDC session: http://asciiwwdc.com/2014/sessions/419

    So, and to reiterate on what devices we don't blur and that we only do the tinting on the iPad 2 and iPad 3rd generation, we just apply the tint and we skip the blur steps.

    [...]

    On iPad 4th generation, iPad Air, iPad Mini, iPad Mini with retina display, iPhones and the iPod touch we do both the blur and the tinting.

    I guess you have to resort to checking for the machine name:

    #import <sys/utsname.h>
    ...
    
    struct utsname systemInfo;
    uname(&systemInfo);
    
    NSString *deviceName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
    ...
    
    0 讨论(0)
  • 2021-01-04 07:58

    Apple internally uses [UIDevice _graphicsQuality] for these kind of checks. In the following post I propose a method that does the same using only public API: https://stackoverflow.com/a/27879304/1914276

    0 讨论(0)
提交回复
热议问题