Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System blur style before iOS 13.0 warning when using material style in storyboard

I'm trying to adapt my app to iOS 13 dark mode, and when I set a UIVisualEffectView's blur to any of the new modes (like material) in Storyboard I get the warning:

System blur style before iOS 13.0

I understand that, as well as I can use version checks in code to support both iOS 13 and previous versions. However, I'm not sure how to do it in Storyboard (which I prefer), and when I run the app in an iOS 12 device, it actually renders fine (falls back correctly).

How can I get rid of the warning?

Thank you!

like image 221
danqing Avatar asked Sep 22 '19 23:09

danqing


1 Answers

Afaik there is not a solution in storyboard. You have to do this in code.

    if #available(iOS 13.0, *) {
        return UIBlurEffect(style: .systemUltraThinMaterial)
    } else {
        return UIBlurEffect(style: .regular)
   }
like image 105
BilalReffas Avatar answered Nov 07 '22 07:11

BilalReffas