sberrevoets / SDCAlertView

The little alert that could
MIT License
1.86k stars 297 forks source link

Different look for dark theme in ios 13 and ios 12 #314

Closed salos1982 closed 3 years ago

salos1982 commented 4 years ago

Hello,

I'm using this great alert view. But I found an issue I cannot understand. I use a dark theme for my application. And on ios 13 it works correctly. Like on image bellow

Screen Shot 2020-07-07 at 12 19 34

But on ios 12 it looks very different

Screen Shot 2020-07-07 at 12 24 31

I do not understand why

sberrevoets commented 4 years ago

It's likely some change in UIKit between iOS 12 and 13, but not sure what that would be.

salos1982 commented 4 years ago

I found reason

var blurEffect: UIBlurEffect {
        if #available(iOS 13, *) {
            return UIBlurEffect(style: .systemMaterial)
        } else if #available(iOS 10, *) {
            return UIBlurEffect(style: .prominent)
        } else {
            return UIBlurEffect(style: .extraLight)
        }
    }

for ios 12 this property in AlertVisualStyle returns UIBlurEffect(style: .prominent). If replace this return to UIBlurEffect(style: .dark) it will show everything as I need. However, I cannot change behaviour of this property anyhow.

sberrevoets commented 4 years ago

But then it would be dark even if the user has light mode set?

salos1982 commented 4 years ago

It would be nice if it is possible to override this property. In this case, it would be possible to set up necessary behavior

salos1982 commented 4 years ago

Could you tell me when you merge my pull request and update version?

sberrevoets commented 3 years ago

Handled in #315, sorry for the delay