Created
May 12, 2018 15:26
-
-
Save ahmedk92/8246037bf11adaa12d353d0919865da0 to your computer and use it in GitHub Desktop.
Set default app language
This file contains hidden or 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