Apple has recently opened up the Swift programming language, which means that anyone will be able to use the Swift programming language on any system. Now, Apple first brought Swift to the Ubuntu platform. Next I will introduce how to install and deploy Swift in Ubuntu. What is Swift? Swift is Apple's latest programming language, designed to replace Objective-C as the main language for building apps for MacOSX and iOS. Swift
Apple has recently opened up the Swift programming language, which means that anyone will be able to use the Swift programming language on any system. Now, Apple first brought Swift to the Ubuntu platform. Next I will introduce how to install and deploy Swift in Ubuntu.
What is Swift?
Swift is Apple's latest programming language, designed to replace Objective-C as the main language for building Mac OS X and iOS applications. Swift is simple and easy to learn, and has similar syntaxes with other popular programming languages.
However, the Swift language is only applicable to Apple devices, and programs developed cannot run on Windows, Linux, or other systems. As Swift becomes increasingly popular, more and more developers want apple to open up Swift, at least to support more platforms. Apple also listened to the voice of developers and finally made Swift open-source. From a business perspective, it is better for Apple to make Swift an open source solution, which at least facilitates more developers to create Mac OS X and iOS applications.
If you are interested in learning the Swift programming language, you can install it on Linux anytime. Currently, apple only released the installation programs for Ubuntu 14.04 and Ubuntu 15.10. I believe Apple will soon update the general installation programs for other platforms and Linux platforms.
Official reference: Swift installation tutorial
Step 1: download an object
Download Ubuntu 15.10 Swift 2.2 Snapshot and Signature files including the swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10.tar.gz and the corresponding. sig files.
Step 2: Install Dependencies
Press Ctrl + Alt + T to open the terminal and install clang:
$ sudo apt-get install clang libicu-dev
Step 3: import the new PGP key to the keyring of the Ubuntu System
$ gpg --keyserver hkp://pool.sks-keyservers.net \ --recv-keys \ '7463 A81A 4B2E EA1B 551F FBCF D441 C977 412B 37AD' \ '1BE1 E29A 084C B305 F397 D62A 9F59 7F4D 21A5 6D5F'
Or
$ wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
Step 4: Update Signature Verification
First, update the key certificate:
$ gpg --keyserver hkp://pool.sks-keyservers.net --refresh-keys Swift
Second, verify signature authentication:
$ gpg --verify swift-
-
.tar.gz.sig
Note: The verification file isswift- - .tar.gz.sig
The name of the Signature file downloaded in step 1.
This step may cause a warning and prompt content. You can skip this warning.
Step 5: Decompress the file
$ tar xzf swift-
-
.tar.gz
Here -
It is consistent with the previous step. After decompression, an extra decompressed folder will be added to the current folder.
Step 6: Add Environment Variables
$ Export PATH = ~ /Document/swift/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin: $ {PATH}
"~ /Documentation/swift/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10
Folder is the path of the unzipped .tar.gz file under my computer.
Note:The environment variables added here are only applicable to the current session. You need to add them again after you re-open the terminal.
In order not to re-Add the path every time, you can modify ~ /. Bashrc File$ sudo vim ~/.bashrc
Add the following in the last line of the file:
Export PATH = ~ /Document/swift/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin: $ {PATH}
Note:If you have not installed the vim editor, you can usesudo apt-get install vim
Install.
Start the Swift tour!
Enter$ swift
For more information, see getting strated!
Swift changes: What http://www.linuxidc.com/Linux/2015-12/126440.htm will it bring from 2.2 to 3.0
Swift was officially open-source, while the Swfit core library and Package Manager http://www.linuxidc.com/Linux/2015-12/125847.htm were open-source
Apple Swift tutorial http://www.linuxidc.com/Linux/2014-09/106420.htm
Build an iOS mail application http://www.linuxidc.com/Linux/2014-08/105542.htm with Swift
Swift 2.0 open source http://www.linuxidc.com/Linux/2015-06/118594.htm
Building Swift language development and learning environment http://www.linuxidc.com/Linux/2015-12/125983.htm in Linux
Swift details: Click here
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2016-01/126995.htm