Bekzod
04/18/2024, 12:33 PMimport SwiftUI
import shared
@main
struct iOSApp: App {
init() {
//here
KoinHelperKt.doInitKoin()
}
var body: some Scene {
WindowGroup {
ContentView()
.preferredColorScheme(.light)
}
}
}
but later when I tried to call it in runtime, it did not work. re-opened app still no changes.
fun setLocale(locale: String) {
StringDesc.localeType = StringDesc.LocaleType.Custom(locale)
preferenceManager?.setLocale(locale)
}
If language changed from settings it works.
I'm new to iOS development, need some instructions. Thanks in advance!Bekzod
04/18/2024, 12:52 PMstruct ContentView: View {
@Environment(\.locale) var locale
var body: some View {
// Use the locale to customize your views
Text("Hello, World!")
.environment(\.locale, locale)
}
}
I wonder if I need to use this too, but not sure how to combine both