Change NSDoubleLocalizedStrings at runtime

21 Views Asked by At

In Xcode, I can alter a scheme's App Language to be "Double-length Pseudolanguage" and it will launch with all strings doubled. I'd like to be able to change this at runtime so I can turn it off and on without rebooting the app with a new value.

I attempted to turn it off at runtime with this command:

UserDefaults.standard.set(false, forKey: "NSDoubleLocalizedStrings")

The value was not updated after that command executed:

(lldb) po UserDefaults.standard.value(forKey: "NSDoubleLocalizedStrings")
▿ Optional<Any>
  - some : YES

That seems to have no effect. What are some other approaches to this task without resorting to third-party frameworks?

0

There are 0 best solutions below