mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-03 11:23:48 +00:00
[ios] Removing conditionals for unsupported iOS versions
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -15,23 +15,15 @@ class UINavigationBarRenderer: UIViewRenderer {
|
||||
class func render(_ control: UINavigationBar, style: Style) {
|
||||
super.render(control, style: style)
|
||||
if let barTintColor = style.barTintColor {
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.backgroundColor = barTintColor
|
||||
control.standardAppearance = appearance
|
||||
control.scrollEdgeAppearance = appearance
|
||||
} else {
|
||||
control.barTintColor = barTintColor
|
||||
}
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.backgroundColor = barTintColor
|
||||
control.standardAppearance = appearance
|
||||
control.scrollEdgeAppearance = appearance
|
||||
}
|
||||
if let shadowImage = style.shadowImage {
|
||||
if #available(iOS 13.0, *) {
|
||||
control.standardAppearance.shadowImage = shadowImage
|
||||
control.scrollEdgeAppearance!.shadowImage = shadowImage
|
||||
} else {
|
||||
control.shadowImage = shadowImage
|
||||
}
|
||||
control.standardAppearance.shadowImage = shadowImage
|
||||
control.scrollEdgeAppearance!.shadowImage = shadowImage
|
||||
}
|
||||
|
||||
var attributes = [NSAttributedString.Key: Any]()
|
||||
@@ -41,11 +33,7 @@ class UINavigationBarRenderer: UIViewRenderer {
|
||||
if let fontColor = style.fontColor {
|
||||
attributes[NSAttributedString.Key.foregroundColor] = fontColor
|
||||
}
|
||||
if #available(iOS 13.0, *) {
|
||||
control.standardAppearance.titleTextAttributes = attributes
|
||||
control.scrollEdgeAppearance!.titleTextAttributes = attributes
|
||||
} else {
|
||||
control.titleTextAttributes = attributes
|
||||
}
|
||||
control.standardAppearance.titleTextAttributes = attributes
|
||||
control.scrollEdgeAppearance!.titleTextAttributes = attributes
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user