官术网_书友最值得收藏!

Open source Swift

Apple released Swift as an open source project in December 2015, hosted at open-source version of Swift is similar from a runtime perspective on both Linux and OS X; however, the set of libraries available differ between the two platforms.

For example, the Objective-C runtime was not present in the initial release of Swift for Linux; as a result, several methods that are delegated to Objective-C implementations are not available. "hello".hasPrefix("he") compiles and runs successfully on OS X and iOS but is a compile error in the first Swift release for Linux. In addition to missing functions, there is also a different set of modules (frameworks) between the two platforms. The base functionality on OS X and iOS is provided by the Darwin module, but on Linux, the base functionality is provided by the Glibc module. The Foundation module, which provides many of the data types that are outside of the base-collections library, is implemented in Objective-C on OS X and iOS, but on Linux, it is a clean-room reimplementation in Swift. As Swift on Linux evolves, more of this functionality will be filled in, but it is worth testing on both OS X and Linux specifically if cross platform functionality is required.

Finally, although the Swift language and core libraries have been open sourced, this does not apply to the iOS libraries or other functionality in Xcode. As a result, it is not possible to compile iOS or OS X applications from Linux, and building iOS applications and editing user interfaces is something that must be done in Xcode on OS X.

主站蜘蛛池模板: 本溪市| 鄂尔多斯市| 山西省| 白城市| 仪征市| 南皮县| 宁南县| 哈尔滨市| 措美县| 内乡县| 浮山县| 汉川市| 神池县| 错那县| 深泽县| 汶上县| 北海市| 临湘市| 北安市| 花垣县| 朝阳区| 盱眙县| 津市市| 个旧市| 罗甸县| 闻喜县| 托里县| 探索| 邹城市| 辉县市| 锡林郭勒盟| 铜陵市| 金华市| 灯塔市| 北安市| 聂荣县| 岐山县| 大丰市| 兴业县| 五原县| 寿光市|