Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello,创建 swift 版的 ios 项目时遇到问题 #22

Closed
hw20101101 opened this issue May 13, 2021 · 12 comments
Closed

hello,创建 swift 版的 ios 项目时遇到问题 #22

hw20101101 opened this issue May 13, 2021 · 12 comments
Assignees

Comments

@hw20101101
Copy link

我在 example 目录下使用 flutter create -i swift . 重新创建 ios 项目之后,AppDelegate 中的代码是否可以转为 swift 版?

 
    [ThrioModule init:[MainModule new]];

    UINavigationController *nvc = [[NavigatorNavigationController alloc] initWithUrl:@"/biz1/flutter1" params:nil];
    self.window.rootViewController = nvc;
    [self.window makeKeyAndVisible];

如果可以转 swift,那应该怎样转呢?谢谢!!

@hw20101101
Copy link
Author

hw20101101 commented May 13, 2021

有些第三方 SDK 在 OC 项目中报错,如下:

WX20210512-224820@2x

根据反馈得到的解决办法就是使用 swift 来创建 ios 项目。

@foxsofter
Copy link
Contributor

这个不用问吧,就是一个如何在 Swift 项目中引用 objc 代码

@hw20101101
Copy link
Author

转到 swift 之后报错 No such module 'thrio'

WX20210513-195708@2x

WX20210513-201050@2x

@foxsofter
Copy link
Contributor

@hw20101101
Copy link
Author

@foxsofter thanks,还差最后一步。

ThrioModule 和 MainModule 初始化报错:

WX20210514-144231@2x

@foxsofter
Copy link
Contributor

你应该调 init 方法

@hw20101101
Copy link
Author

hw20101101 commented May 16, 2021

@foxsofter init 也报这个错误

WX20210516-153256@2x

@foxsofter
Copy link
Contributor

不是同一个 init 方法 _

@hw20101101
Copy link
Author

@foxsofter 那是什么?能不能举个例子?

@foxsofter
Copy link
Contributor

image

@hw20101101
Copy link
Author

@foxsofter 感谢!

@hw20101101
Copy link
Author

hw20101101 commented May 16, 2021

@foxsofter 感谢!

终于可以了,从未接触过这种写法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants