I am converting my obj-c app to Swift. For the purpose of overriding system language preferences I am setting my locale in main.m. Something like this:
int main(int argc, char *argv[])
{
@autoreleasepool {
[defaults setObject:@"myweirdlocale" forKey:@"AppleLanguages"];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
This needs to happen early, before any UIKit method is used. didFinishLaunchingWithOptions in AppDelegate is too late. Since there is no main function in Swift. Is there a chance of doing this in Swift?