Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/106.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何选择要在Nativescript中使用的Swift编译器版本?_Ios_Nativescript - Fatal编程技术网

Ios 如何选择要在Nativescript中使用的Swift编译器版本?

Ios 如何选择要在Nativescript中使用的Swift编译器版本?,ios,nativescript,Ios,Nativescript,我遇到了一个问题,因为库nativescripttoast在Swift 3中使用的是iOS Toaster版本,而不是在v4中。 这使得我在运行tns run ios时构建失败 在阅读了一些帖子之后,我找到了一个解决方案,那就是打开xcode,进入Build Settings,对于Toaster目标,在Swift Language Version中选择Swift 3, 通过这种方式,我可以使用xCode构建我的应用程序。。。但这也是一个问题,因为它没有反映我在VS代码中实时所做的更改,而我在xC

我遇到了一个问题,因为库
nativescripttoast
在Swift 3中使用的是iOS Toaster版本,而不是在v4中。 这使得我在运行
tns run ios
时构建失败

在阅读了一些帖子之后,我找到了一个解决方案,那就是打开xcode,进入Build Settings,对于
Toaster
目标,在
Swift Language Version
中选择Swift 3, 通过这种方式,我可以使用xCode构建我的应用程序。。。但这也是一个问题,因为它没有反映我在VS代码中实时所做的更改,而我在xCode中所做的更改只会影响iOS,而不会影响Android,因为我在platform/iOS文件夹中。

试试看

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'Toaster'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '3.0'
      end
    end
  end
end

基于插件的nStudio积分

Ahh ok!我发现这需要添加到pod文件中。。伟大的我试试看,然后回来!