我正在尝试将一些基本应用程序从 OS X 移植到 Linux,但似乎在 Linux 平台上连基本的东西都缺失了。是否缺少一些文档? 这是示例:
exmcast.swift:7:20: error: value of type 'String' has no member 'stringByReplacingOccurrencesOfString'
let name: String = address.stringByReplacingOccurrencesOfString(".", withString: "_")
这个简单的代码适用于 OS X。在 Linux 上 - 您会看到结果。 当没有缺少的基本信息时,很难移植任何东西。 看起来连基本的东西都不见了..
最佳答案
Swift 3 将于 2016 年秋季发布。
最近开源的 Swift 和 Linux 端口是 work in progress :
The port is still a work in progress but we’re happy to say that it is usable today for experimentation.
你可以去Swift.org和 github.com/apple并享受出色的工作。
当您发现尚未实现的内容时,您可以提交错误和/或帮助实现该功能。
open source Swift 的新版本将定期发布在 Swift.org 上。
关于linux - Swift 2 和 Linux/OS X 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34294578/