refact: use DoricSingleton to hold all static or singleton objects

This commit is contained in:
pengfei.zhou
2021-07-21 17:56:03 +08:00
committed by osborn
parent 7d4d6713c6
commit 61c262bcc6
30 changed files with 320 additions and 221 deletions

View File

@@ -9,7 +9,7 @@
#import "AppDelegate.h"
#import "NavigationController.h"
#import "ViewController.h"
#import "DoricRegistry.h"
#import <DoricCore/Doric.h>
#if __has_include(<SDWebImage/SDWebImage.h>)
@@ -27,7 +27,7 @@ @implementation AppDelegate
- (void)localeChanged {
[DoricRegistry setEnvironmentValue:@{
[Doric setEnvironmentValue:@{
@"localeLanguage": [[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleLanguageCode],
@"localeCountry": [[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleCountryCode],
}];

View File

@@ -46,9 +46,9 @@ - (void)viewDidLoad {
it.dataSource = self;
it.delegate = self;
}]];
[DoricRegistry register:[DemoLibrary new]];
[DoricRegistry enablePerformance:YES];
[DoricRegistry enableRenderSnapshot:YES];
[Doric registerLibrary:[DemoLibrary new]];
[Doric enablePerformance:YES];
[Doric enableRenderSnapshot:YES];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {