feat:add set environment value api

This commit is contained in:
pengfei.zhou
2021-07-07 17:30:08 +08:00
committed by osborn
parent 0c10b513b9
commit e6595d5c51
18 changed files with 157 additions and 30 deletions

View File

@@ -9,10 +9,15 @@
#import "AppDelegate.h"
#import "NavigationController.h"
#import "ViewController.h"
#import "DoricRegistry.h"
#if __has_include(<SDWebImage/SDWebImage.h>)
#import <SDWebImage/SDWebImage.h>
#import <SDWebImageWebPCoder/SDWebImageWebPCoder.h>
#endif
@interface AppDelegate ()
@property(nonatomic, strong) UIViewController *rootVC;
@property(nonatomic, strong) NavigationController *navigationController;
@@ -21,8 +26,20 @@ @interface AppDelegate ()
@implementation AppDelegate
- (void)localeChanged {
[DoricRegistry setEnvironmentValue:@{
@"localeLanguage": [[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleLanguageCode],
@"localeCountry": [[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleCountryCode],
}];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(localeChanged)
name:UITextFieldTextDidChangeNotification
object:nil];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.rootVC = [[ViewController alloc] init];

View File

@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>