感谢支持
我们一直在努力

Ubuntu 14.04.4 下安装 Swift 2.2.1

Swift 2.2.1最近发布下载了是一个互动和有趣的编程语言,适用于iOSOS X,tvOSwatchOS语法简洁而富有表现力,应用程序运行快如闪电Swift 2.2带来了新的语法,新功能

功能特性:

  • Swift 2.2 includes support for Swift on Linux. The Linux port is still relatively new and in this release does not include the Swift Core Libraries (which will appear in Swift 3). The port does, however, include LLDB and the REPL.
  • Swift 2.2 introduces a new compiler directive that makes cross-version compatibility a cinch: you can now specify blocks of code that should be read only if the compiler supports a specific Swift language version
  • As of Swift 2.2, any keyword can be used as an argument label, with the exception of inout, var, and let
  • Swift 2.2 introduces the ability to compare two tuples for equality, which means it will check each element in one tuple against the matching element in another, and report true if all elements match

新功能完整细节见发布下载日志。

开发文档有Linux环境的,简单试下。Ubuntu 14.04.4 安装 Swift 2.2.1 过程见下面:

下载压缩包: https://swift.org/download/

选择自己的环境,下载对应的压缩包,我这里下载 swift-2.2.1-RELEASE-ubuntu14.04.tar.gz

https://swift.org/builds/swift-2.2.1-release/ubuntu1404/swift-2.2.1-RELEASE/swift-2.2.1-RELEASE-ubuntu14.04.tar.gz

到 home/www.linuxidc.com 目录下

# 解压缩
$ tar zxvf swift-2.2.1-RELEASE-ubuntu14.04.tar.gz

配置环境变量

# 编辑 .bashrc
vim ~/.bashrc

# 在文件底部插入环境变量
export PATH=swift-2.2.1-RELEASE-ubuntu14.04/usr/bin/:”${PATH}”

验证环境变量

www.linuxidc.com@linuxidc:~$ export PATH=swift-2.2.1-RELEASE-ubuntu14.04/usr/bin/:”${PATH}”
www.linuxidc.com@linuxidc:~$ swift
Welcome to Swift version 2.2.1 (swift-2.2.1-RELEASE). Type :help for assistance.
  1> var name = “www.linuxidc.com”
name: String = “www.linuxidc.com”
  2> var url = “http://\(name)”
url: String = “http://www.linuxidc.com”
  3> print(“Hello, http://www.linuxidc.com”)
Hello, http://www.linuxidc.com
  4>

Ubuntu 14.04.4 下安装 Swift 2.2.1

最新的Ubuntu 14.04.4没有安装sudo apt-get install clang libicu-dev也可以。

Ubuntu 15.10安装部署Swift开发环境  http://www.linuxidc.com/Linux/2016-01/126995.htm 

Swift 的变化:从 2.2 到 3.0 会带来什么  http://www.linuxidc.com/Linux/2015-12/126440.htm 

Swift 正式开源,同时开源 Swfit 核心库和包管理器 http://www.linuxidc.com/Linux/2015-12/125847.htm 

Apple Swift学习教程  http://www.linuxidc.com/Linux/2014-09/106420.htm 

使用 Swift 构建一个 iOS 的邮件应用 http://www.linuxidc.com/Linux/2014-08/105542.htm 

Swift 2.0开源化  http://www.linuxidc.com/Linux/2015-06/118594.htm 

Linux下搭建Swift语言开发学习环境 http://www.linuxidc.com/Linux/2015-12/125983.htm 

Swift 的详细介绍:请点这里 

更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-05/131249.htm

赞(0) 打赏
转载请注明出处:服务器评测 » Ubuntu 14.04.4 下安装 Swift 2.2.1
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏