iOS 13 crash related to "AppleLanguages"

Hello! I set localization manually in my app using "AppleLanguages" property in UserDefaults. Unfortunately, I was inattentive and wrote one case when localization is set like a plain string, not an array.
Like this one:

UserDefaults.standard.set("en", forKey: "AppleLanguages")

It's apparently incorrect, and it's my fault that I haven't spotted it earlier. However, this row didn't cause any serious problems on iOS 12, but on iOS 13 it causes terrible crashes. If locale is set that way once, the application crashes even before AppDelegate has started. Furthermore, even system settings crash. I've fixed my code, but I want fix application for users who have this problem. Is there any trick to clean or fix UserDefaults beforeAppDelegatehas started?


Kind regards.


P.S. I hope Apple will release a patch. iOS mustn't behave so weird.

Replies

me too .....
is the same, work on below iOS 12 , crash on iOS 13 ..........

You need to set array

UserDefaults.standard.set(["en"], forKey: "AppleLanguages") 

iPhone ok, but MAC and iPad won’t show views.


was my proble, but new topic does forbidden error.