-
-
Save embassem/ed45bfc80492f653d14d01396487e778 to your computer and use it in GitHub Desktop.
Set default app language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApplication: UIApplication { | |
override init() { | |
let notFirstOpenKey = "notFirstOpen" | |
let notFirstOpen = UserDefaults.standard.bool(forKey: notFirstOpenKey) | |
if notFirstOpen == false { | |
UserDefaults.standard.set(["ar"], forKey: "AppleLanguages") | |
UserDefaults.standard.set(true, forKey: notFirstOpenKey) | |
} | |
super.init() | |
} | |
} | |
UIApplicationMain( | |
CommandLine.argc, | |
UnsafeMutableRawPointer(CommandLine.unsafeArgv) | |
.bindMemory( | |
to: UnsafeMutablePointer<Int8>.self, | |
capacity: Int(CommandLine.argc) | |
), | |
NSStringFromClass(MyApplication.self), | |
NSStringFromClass(AppDelegate.self) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment