Friday, March 15, 2024
HomeiOS Developmentios - Change NSDoubleLocalizedStrings at runtime

ios – Change NSDoubleLocalizedStrings at runtime


In Xcode, I can alter a scheme’s App Language to be “Double-length Pseudolanguage” and it’ll launch with all strings doubled. I might like to have the ability to change this at runtime so I can flip it on and off with out rebooting the app with a brand new worth.

I tried to show it off at runtime with this command:

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

The worth was not up to date after that command executed:

(lldb) po UserDefaults.customary.worth(forKey: "NSDoubleLocalizedStrings")
â–¿ Elective<Any>
  - some : YES

That appears to don’t have any impact. What are another approaches to this job with out resorting to third-party frameworks?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments