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