mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 05:43:37 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
25 lines
713 B
Swift
25 lines
713 B
Swift
extension UINavigationItem {
|
|
@objc func applyTheme() {
|
|
if styleName.isEmpty {
|
|
setStyle(.navigationBarItem)
|
|
}
|
|
for style in StyleManager.shared.getStyle(styleName)
|
|
where !style.isEmpty {
|
|
UINavigationItemRenderer.render(self, style: style)
|
|
}
|
|
}
|
|
}
|
|
class UINavigationItemRenderer {
|
|
class func render(_ control: UINavigationItem, style: Style) {
|
|
if let item = control.backBarButtonItem {
|
|
UIBarButtonItemRenderer.render(item, style: style)
|
|
}
|
|
if let item = control.leftBarButtonItem {
|
|
UIBarButtonItemRenderer.render(item, style: style)
|
|
}
|
|
if let item = control.rightBarButtonItem {
|
|
UIBarButtonItemRenderer.render(item, style: style)
|
|
}
|
|
}
|
|
}
|