feat: added flag emoji instead of country code in the popup view, and countryCode and flag options to the Text widget (#2916)

This commit is contained in:
Serhiy Mytrovtsiy
2026-02-23 19:26:00 +01:00
parent 3812657460
commit dec8f08749
5 changed files with 24 additions and 3 deletions

View File

@@ -1848,3 +1848,10 @@ public func isWidgetActive(_ defaults: UserDefaults?, _ widgets: [String]) -> Bo
}
return false
}
public func countryFlag(_ code: String) -> String? {
let uppercased = code.uppercased()
guard uppercased.count == 2 else { return nil }
let scalars = uppercased.unicodeScalars.compactMap { UnicodeScalar(127397 + $0.value) }
return scalars.count == 2 ? String(String.UnicodeScalarView(scalars)) : nil
}