|
Apple recently open sourced Swift programming language, which means that anyone will be able to use the Swift programming language on any system. Now, Apple is first brought to the Ubuntu platform Swift, here I'll show you how to install Ubuntu deployment Swift.
What is Swift?
Swift Apple's latest programming language, its purpose is to replace the Objective-C language to build a major Mac OS X and iOS applications. Swift is very simple to learn, but also with other popular programming languages have similar syntax, easy to use.
However, Swift language applies only to Apple devices, the development of the program will not run on Windows, Linux or other systems. With Swift growing popularity, more and more developers are hoping that Apple will open Swift, at least let it be able to support more platforms. Apple is also rare to hear the voice of the majority of developers will eventually Swift was open. Not as good as from a commercial point of view, Apple will Swift Open source is a very good move, it can at least facilitate more developers to create Mac OS X and iOS applications.
If you are interested in learning Swift programming language that can be installed at any time on Linux. Apple currently only released for Ubuntu 14.04 and Ubuntu 15.10 installer, I believe Apple will soon update other platforms and Linux platforms Universal Installer.
Official References: Swift installation tutorial
Step One: Download file
Download Ubuntu 15.10 Swift 2.2 Snapshot and Signature files, download files include swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10.tar.gz .sig and the corresponding file.
Step 2: Install Dependency
Use the keyboard shortcut Ctrl + Alt + T to open the terminal, installation clang:
$ Sudo apt-get install clang libicu-dev
The third step: keyring Ubuntu system to import new PGP secret key
$ 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 four: Update signature verification
First, update the secret key certificate:
$ Gpg --keyserver hkp: //pool.sks-keyservers.net --refresh-keys Swift
Secondly, to verify the signature certification:
$ Gpg --verify swift- < VERSION> - < PLATFORM> .tar.gz.sig
Note: Verify that the file is swift- < VERSION> - < PLATFORM> .tar.gz.sig, Signature is the first step in the file name to download.
This step may appear warning that the content shown in FIG warning without pipe line.
Step Five: Unzip the file
$ Tar xzf swift- < VERSION> - < PLATFORM> .tar.gz
Where < VERSION> - < PLATFORM> consistent with the previous step. After unpacking, it will be more after extracting a file folder in the current folder.
Step Six: Add the environment variable
$ Export PATH = ~ / Documents /swift/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin:${PATH}
The "~ / Documents /swift/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10" is my computer files after extracting .tar.gz file folder path.
Note: This add environment variables that apply only in the current session, after the next re-open the terminal needs to re-add.
To re-add not every path, you can modify ~ / .bashrc file $ sudo vim ~ / .bashrc
In the last line add:
export PATH = ~ / Documents /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 sudo apt-get install vim installed.
Swift began to journey!
In the terminal input $ swift |
|
|
|