Skip to content

Commit 8672f07

Browse files
committed
Replace a deprecated UIVibrancyEffect initialization syntax
I did my best to find a valid replacement and left a note to hopefully help improving upon my attempt.
1 parent c4ad88e commit 8672f07

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ class WidgetStyles: NSObject {
1616
}
1717
}()
1818

19-
static var separatorVibrancyEffect: UIVibrancyEffect = {
20-
if #available(iOS 13, *) {
21-
return .widgetEffect(forVibrancyStyle: .separator)
22-
} else {
23-
return .widgetSecondary()
24-
}
25-
}()
19+
// Note: Before supporting only iOS 14+, this used to be:
20+
//
21+
// - .widgetEffect(forVibrancyStyle: .separator) in iOS 13+
22+
// - .widgetSecondary() in previous versions
23+
//
24+
// Hopefully this information is useful if the current implementation is not visually satisfying.
25+
static var separatorVibrancyEffect = UIVibrancyEffect(
26+
blurEffect: UIBlurEffect(style: .regular),
27+
style: .separator
28+
)
2629

2730
static func configureSeparator(_ separator: UIView) {
2831
// Both colors are need for the vibrancy effect.

0 commit comments

Comments
 (0)