Tencent / wcdb

WCDB is a cross-platform database framework developed by WeChat.
Other
10.78k stars 1.41k forks source link

同一个项目Objective-C的WCDB能否和swift版本的WCDB一起使用? #1138

Closed superyang2019 closed 2 months ago

superyang2019 commented 2 months ago

The language of WCDB

e.g. Objective-C, Swift

The version of WCDB

e.g. v2.1(swift) OC版本1.1.0

The platform of WCDB

e.g. iOS

The installation of WCDB

e.g. Cocoapods

What's the issue?

Post the outputs or screenshots for errors. 我想咨询一下,目前我们是16年的老项目,早期是OC版本,目前正在用swift版本进行一部分模块的重构,早期OC使用了wcdb1.1.0版本,线上业务运行还算正常,现在重构的模块计划用swift2.1版本的WCDB,想问一下,如何让一个项目中继运行OC版本的WCDB,又运行swift版本的wcdb,如果不能同时运行,能不能给一些指导性建议,谢谢。 Explain what you want by example or code in English.

Qiuwen-chen commented 2 months ago

You should use WCDB Swift 2.1 and WCDB Objc 2.1 together.

superyang2019 commented 2 months ago

那 WCDB Swift 2.1 and WCDB Objc 2.1 一起使用,两个组件底层有很多相同的c++代码,而且有一些写了#pragma once image

Qiuwen-chen commented 2 months ago

You can WCDB directly, it contains Objc, Swift, C++ interfaces in one framework.