feat:update init script
This commit is contained in:
parent
9ba32487c6
commit
ce35ebc40e
@ -117,8 +117,9 @@ function initiOS(path, name) {
|
||||
return console.error(err);
|
||||
}
|
||||
copyFolder(`${targetiOSPath}`, `${path}`, () => {
|
||||
const mainFiles = `Example/ViewController.m`
|
||||
fs.writeFileSync(`${path}/${mainFiles}`, fs.readFileSync(`${targetiOSPath}/${mainFiles}`).toString().replace(/__\$__/g, name))
|
||||
['Example/SceneDelegate.m', 'Example/AppDelegate.m'].forEach(e => {
|
||||
fs.writeFileSync(`${path}/${e}`, fs.readFileSync(`${targetiOSPath}/${e}`).toString().replace(/__\$__/g, name))
|
||||
})
|
||||
console.log(`Create Doric iOS Project Success`)
|
||||
})
|
||||
})
|
||||
|
@ -7,7 +7,7 @@ @interface SceneDelegate ()
|
||||
@implementation SceneDelegate
|
||||
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
|
||||
UIWindowScene *windowScene = (UIWindowScene *) scene;
|
||||
NSString *bundleName = @"mcd";
|
||||
NSString *bundleName = @"__$__";
|
||||
DoricViewController *doricViewController = [[DoricViewController alloc] initWithScheme:[NSString stringWithFormat:@"assets://src/%@.js", bundleName] alias:bundleName];
|
||||
doricViewController.view.backgroundColor = [UIColor whiteColor];
|
||||
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:doricViewController];
|
||||
|
Reference in New Issue
Block a user