如何将Thrift 0.12导入Xcode以支持Swift 4.2

时间:2019-07-01 19:46:31

标签: ios swift xcode import thrift

我正在尝试建立一个新项目,该项目在Xcode中支持Thrift 0.12和Swift 4.2。在我的Thrift生成的swift文件中,所有文件都带有“ import Thrift”行,但出现编译错误“ No such module'Thrift'”。我不知道如何解决这个问题。将Thrift作为cocoapod导入似乎不起作用,因为尽管pod似乎是0.10,但我可以下载的最新版本不支持Swift 4.2。我已经在Mac上下载了Thrift 0.12,这是我首先生成Thrift-to-swift文件的方式。下面是生成的文件之一。

我尝试过: x = c("OBJECTIVES: In diabetic polyneuropathy (DPN) patients, the effect of folic acid and homocysteine has been related to components of nerve conduction velocity (NCV). The objective of this study was to determine the effect of folic acid supplementation on NCV in DPN patients. METHODS: Patients were randomized to receive either 1 mg of folic acid (n = 40) or placebo (n = 40) for 16 weeks. Blood samples were collected to assess serum folic acid and homocysteine concentrations, and NCV was performed for assessment of diabetic neuropathy. RESULTS: At 16 weeks, in the supplemented group, serum levels of folic acid (p < 0.001) increased, homocysteine concentrations decreased (p < 0.001), with no change in serum vitamin B12 levels. There was a significant increase in sensory sural amplitude (p < 0.001), and components of motor nerves, including amplitude (p = 0.001) and velocity (p < 0.001), but decreased onset latency of peroneal (p = 0.019) and tibial (p = 0.011) motor nerves. CONCLUSION: Our data suggest that supplementation with 1 mg of folic acid for 16 weeks may be useful for enhancing NCV in DPN patients.", "no numbers here", "n = 100") pod "Thrift" 他们俩都不起作用。

我生成的swift文件:

pod 'Thrift-swift3', :git => 'git@github.com:apache/thrift.git', :branch => 'master'

1 个答案:

答案 0 :(得分:2)

我为Swift 4.2+兼容性(https://github.com/apache/thrift/pull/1827)制作了一个PR,并将其合并。

因此,您的Podfile中现在有一个可行的解决方案:

pod 'Thrift', :git => 'git@github.com:apache/thrift.git'