I followed the advice from one of the latest WWDC videos on how to handle localization and in my app I launch Settings
of my app when the user wants to change the app language (not system language).
The user can then select one of the available languages that my app is localized for.
The localization part works well, but sometimes it happens that when I click the < My app
button in the leading, top corner or just navigate back to my app, I encounter a frozen screen and then the app just quits and restarts after 2-3 seconds.
I don't need to preserve any state when the user changes the language, but I would certainly like to prevent this freeze from happening. The desired behaviour would be that the app restarts once the use changes the app language.
I use SwiftUI
as the UI framework.
I use the following code to open the Settings
of my app for the user:
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)
How can I achieve that?