sberrevoets / SDCAlertView

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

If background color is set, then blur will be hidden #330

Closed ftp27 closed 1 year ago

ftp27 commented 1 year ago

Small fix wich helps to tune visual style properly

sberrevoets commented 1 year ago

Can you add before/after screenshots just so I have an idea of what you're trying to accomplish?

ftp27 commented 1 year ago

@sberrevoets I want to have a legal way to remove the blur effect from the action sheet. In my view, it is not completely right to deprive us of such a feature. Simulator Screen Shot - iPhone 14 Pro - 2022-09-18 at 11 59 21

sberrevoets commented 1 year ago

I see what you mean, but that means that anyone that wants to provide a blur + background color (as in your first screenshot) won't be able to do so anymore and this would be a breaking change for them.

Maybe it's better to add a property to the visual style to explicitly disable the blur?

ftp27 commented 1 year ago

If we add new property (isBlurEnabled, for example) so we'll need some default background color (may be this one secondarySystemBackground). On the other hand, I can see the lines https://github.com/sberrevoets/SDCAlertView/blob/b368d2e3c783ad191721dd5272c5529c2d8751f4/Source/AlertVisualStyle.swift#L23-L25 That makes you assume that if you use this property then blur will not be applied.

sberrevoets commented 1 year ago

Yeah just add a backgroundBlurEnabled property and if someone disables it without setting a background color, they'll notice and can fix it by setting the backgroundColor property.

ftp27 commented 1 year ago

Yep. Now it looks better

sberrevoets commented 1 year ago

Great, thanks!

sberrevoets commented 1 year ago

I'll try to cut a release later this week