Files
comaps/iphone/Maps/Core/Theme/StyleSheet.swift
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
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
2025-05-08 21:10:51 +07:00

28 lines
1.0 KiB
Swift

protocol StyleStringRepresentable {
var rawValue: String { get }
func styleResolverFor(colors: IColors, fonts: IFonts) -> Theme.StyleResolver
}
extension Theme {
enum StyleResolver {
case add(_ resolver: Theme.Resolver)
case addFrom(_ from: StyleStringRepresentable, _ resolver: Theme.Resolver)
case addFromType(_ forType: ThemeType, _ resolver: Theme.Resolver)
case addFromForType(_ from: StyleStringRepresentable, _ forType: ThemeType, _ resolver: Theme.Resolver)
}
func add(_ style: StyleStringRepresentable, _ resolvingType: StyleResolver) {
switch resolvingType {
case .add(let resolver):
add(styleName: style.rawValue, resolver)
case .addFrom(let from, let resolver):
add(styleName: style.rawValue, from: from.rawValue, resolver)
case .addFromType(let forType, let resolver):
add(styleName: style.rawValue, forType: forType, resolver)
case .addFromForType(let from, let forType, let resolver):
add(styleName: style.rawValue, from: from.rawValue, forType: forType, resolver)
}
}
}